[kernel/f17] ARM: add patch to correctly initialise USB on beagleboards

Dennis Gilmore ausil at fedoraproject.org
Tue May 15 18:59:28 UTC 2012


commit 34b6abb66fbf91ac552d49ae1d270a30210e2296
Author: Dennis Gilmore <dennis at ausil.us>
Date:   Tue May 15 13:58:41 2012 -0500

    ARM:  add patch to correctly initialise USB on beagleboards

 arm-beagle-usb-init.patch |  132 +++++++++++++++++++++++++++++++++++++++++++++
 kernel.spec               |    6 ++
 2 files changed, 138 insertions(+), 0 deletions(-)
---
diff --git a/arm-beagle-usb-init.patch b/arm-beagle-usb-init.patch
new file mode 100644
index 0000000..4af7c65
--- /dev/null
+++ b/arm-beagle-usb-init.patch
@@ -0,0 +1,132 @@
+From: "Govindraj.R" <govindraj.raja at ti.com>
+
+All beagle boards rev > AX/BX have external usb hubs connected to ehci
+interface, external hub/peripheral uses a nreset sequence for which
+uart2_rx.gpio_147 pin in mux mode4(USB2HS_nRST) is used on all beagle
+boards expect rev Ax/BX.
+(Reference to all beagle boards rev schematics:
+http://beagleboard.org/hardware/design)
+
+Initialising uart2 will lead to serial init taking over uart2_rx pin
+so init uart2_rx pin mux only for Beagle AX/BX rev boards.
+Dont init uart2 for all other boards allowing usb_ehci functionality.
+
+To initialise individual uart port by id utilise and modify the existing
+available func. omap_serial_board_init.
+
+Cc: Tony Lindgren <tony at atomide.com>
+Cc: Kevin Hilman <khilman at ti.com>
+Cc: Koen Kooi <koen at dominion.thruhere.net>
+Tested-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
+Tested-by: Robert Nelson <robertcnelson at gmail.com>
+Signed-off-by: Govindraj.R <govindraj.raja at ti.com>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c  |    6 +++-
+ arch/arm/mach-omap2/serial.c             |   41 ++++++++++++++++-------------
+ arch/arm/plat-omap/include/plat/serial.h |    3 +-
+ 3 files changed, 30 insertions(+), 20 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 7ffcd28..19d6fb5 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -126,6 +126,7 @@ static void __init omap3_beagle_init_rev(void)
+ 		beagle_config.mmc1_gpio_wp = 29;
+ 		beagle_config.reset_gpio = 170;
+ 		beagle_config.usr_button_gpio = 7;
++		omap_serial_board_init(NULL, 1);
+ 		break;
+ 	case 6:
+ 		printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n");
+@@ -528,7 +529,10 @@ static void __init omap3_beagle_init(void)
+ 	platform_add_devices(omap3_beagle_devices,
+ 			ARRAY_SIZE(omap3_beagle_devices));
+ 	omap_display_init(&beagle_dss_data);
+-	omap_serial_init();
++	omap_serial_board_init(NULL, 0);
++	omap_serial_board_init(NULL, 2);
++	omap_serial_board_init(NULL, 3);
++
+ 	omap_sdrc_init(mt46h32m32lf6_sdrc_params,
+ 				  mt46h32m32lf6_sdrc_params);
+ 
+diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
+index f590afc..e7c0462 100644
+--- a/arch/arm/mach-omap2/serial.c
++++ b/arch/arm/mach-omap2/serial.c
+@@ -393,30 +393,32 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
+ /**
+  * omap_serial_board_init() - initialize all supported serial ports
+  * @info: platform specific data pointer
++ * @port_id: uart port number to be initialised
+  *
+- * Initializes all available UARTs as serial ports. Platforms
++ * Initializes individual UARTs as serial ports. Platforms
+  * can call this function when they want to have default behaviour
+- * for serial ports (e.g initialize them all as serial ports).
++ * for serial ports (e.g initialize individual serial ports based on port id).
+  */
+-void __init omap_serial_board_init(struct omap_uart_port_info *info)
++void __init omap_serial_board_init(struct omap_uart_port_info *info, u8 port_id)
+ {
+ 	struct omap_uart_state *uart;
+ 	struct omap_board_data bdata;
+ 
+-	list_for_each_entry(uart, &uart_list, node) {
+-		bdata.id = uart->num;
+-		bdata.flags = 0;
+-		bdata.pads = NULL;
+-		bdata.pads_cnt = 0;
+-
+-		if (cpu_is_omap44xx() || cpu_is_omap34xx())
+-			omap_serial_fill_default_pads(&bdata);
+-
+-		if (!info)
+-			omap_serial_init_port(&bdata, NULL);
+-		else
+-			omap_serial_init_port(&bdata, &info[uart->num]);
+-	}
++	list_for_each_entry(uart, &uart_list, node)
++		if (uart->num == port_id) {
++			bdata.id = uart->num;
++			bdata.flags = 0;
++			bdata.pads = NULL;
++			bdata.pads_cnt = 0;
++
++			if (!cpu_is_omap24xx())
++				omap_serial_fill_default_pads(&bdata);
++
++			if (!info)
++				omap_serial_init_port(&bdata, NULL);
++			else
++				omap_serial_init_port(&bdata, info);
++		}
+ }
+ 
+ /**
+@@ -428,5 +430,8 @@ void __init omap_serial_board_init(struct omap_uart_port_info *info)
+  */
+ void __init omap_serial_init(void)
+ {
+-	omap_serial_board_init(NULL);
++	struct omap_uart_state *uart;
++
++	list_for_each_entry(uart, &uart_list, node)
++		omap_serial_board_init(NULL, uart->num);
+ }
+diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
+index 198d1e6..043b251 100644
+--- a/arch/arm/plat-omap/include/plat/serial.h
++++ b/arch/arm/plat-omap/include/plat/serial.h
+@@ -111,7 +111,8 @@ struct omap_uart_port_info;
+ 
+ extern void omap_serial_init(void);
+ extern int omap_uart_can_sleep(void);
+-extern void omap_serial_board_init(struct omap_uart_port_info *platform_data);
++extern void omap_serial_board_init(struct omap_uart_port_info *platform_data,
++		u8 port_id);
+ extern void omap_serial_init_port(struct omap_board_data *bdata,
+ 		struct omap_uart_port_info *platform_data);
+ #endif
+-- 
+1.7.5.4
diff --git a/kernel.spec b/kernel.spec
index e572222..a25dca5 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -742,6 +742,7 @@ Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch
 # ARM tegra
 Patch21004: arm-tegra-nvec-kconfig.patch
 Patch21005: arm-tegra-usb-no-reset-linux33.patch
+Patch21006: arm-beagle-usb-init.patch
 
 # ARM highbank patches
 # Highbank clock functions need to be EXPORT for module builds
@@ -1361,6 +1362,7 @@ ApplyPatch nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch
 ApplyPatch arm-smsc-support-reading-mac-address-from-device-tree.patch
 ApplyPatch arm-tegra-nvec-kconfig.patch
 ApplyPatch arm-tegra-usb-no-reset-linux33.patch
+ApplyPatch arm-beagle-usb-init.patch
 
 #
 # bugfixes to drivers and filesystems
@@ -2415,6 +2417,10 @@ fi
 #    '-'      |  |
 #              '-'
 %changelog
+* Tue May 15 2012 Dennis Gilmore <dennis at ausil.us>
+- add patch to setup usb correctly on beagleboards
+- allows networking to work
+
 * Tue May 15 2012 Josh Boyer <jwboyer at redhat.com>
 - Fixup atl1c register programming (rhbz 749276)
 


More information about the scm-commits mailing list