Skip to contentSkip to conversation

omap3_beagle: Init only uart3 used for console

PATCH New Govindraj.R 4 participants 8 messages Mar 5, 2012 – Mar 6, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

---
 arch/arm/mach-omap2/board-omap3beagle.c |   50 ++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +49 -1
index 817be06..a2e0052 100644
@@ -493,6 +493,54 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
 static struct omap_board_mux board_mux[] __initdata = {
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
+
+static struct omap_device_pad uart3_pads[] __initdata = {
+	{
+		.name	= "uart3_cts_rctx.uart3_cts_rctx",
+		.enable	= OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
+	},
+	{
+		.name	= "uart3_rts_sd.uart3_rts_sd",
+		.enable	= OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
+	},
+	{
+		.name	= "uart3_tx_irtx.uart3_tx_irtx",
+		.enable	= OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
+	},
+	{
+		.name	= "uart3_rx_irrx.uart3_rx_irrx",
+		.flags	= OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
+		.enable	= OMAP_PIN_INPUT | OMAP_MUX_MODE0,
+		.idle	= OMAP_PIN_INPUT | OMAP_MUX_MODE0,
+	},
+};
+
+static inline void board_serial_init(void)
+{
+	struct omap_board_data uart3_bdata;
+	uart3_bdata.flags     = 0;
+	uart3_bdata.pads      = uart3_pads;
+	uart3_bdata.pads_cnt  = ARRAY_SIZE(uart3_pads);
+	uart3_bdata.id        = 2;
+
+	/*
+	 * Init only uart3 used as console
+	 * don't init other uarts as uart mux lines
+	 * might be used for other purpose on beagle board
+	 * ex: uart2_rx used by gpio_147 for usb_ehci phy reset.
+	 */
+	omap_serial_init_port(&uart3_bdata, NULL);
+}
+#else
+
+/*
+ * If mux is disabled from kernel probably we
+ * are relying on boot-loaders so we init all uarts
+ */
+static inline void board_serial_init(void)
+{
+	omap_serial_init();
+}
 #endif
 
 static void __init beagle_opp_init(void)
@@ -549,7 +597,7 @@ 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();
+	board_serial_init();
 	omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 				  mt46h32m32lf6_sdrc_params);
 
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

Op 5 mrt. 2012, om 12:12 heeft Govindraj.R het volgende geschreven:

Quoted 10 lines

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

That's only on xM revision C, right?

regards,

Koen

#2 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

Quoted 8 lines · Koen Kooi

Op 5 mrt. 2012, om 12:12 heeft Govindraj.R het volgende geschreven:

Quoted 5 lines

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

Quoted 7 lines
Quoted 5 lines

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

That's only on xM revision C, right?

Applicable to all beagle boards having external usb hub (USB2HS_nRST will require uart2_rx.gpio_147)

Beagle Rev Ax/Bx doesn't seem to have external hub module so not applicable for those boards

Will modify and post a new patch.

--
Thanks,
Govindraj.R

#3 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

Op 6 mrt. 2012, om 10:03 heeft Raja, Govindraj het volgende geschreven:

Quoted 15 lines · Koen Kooi
Quoted 14 lines

Op 5 mrt. 2012, om 12:12 heeft Govindraj.R het volgende geschreven:

Quoted 10 lines

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

Quoted 4 lines
Quoted 1 line

That's only on xM revision C, right?

Applicable to all beagle boards having external usb hub (USB2HS_nRST will require uart2_rx.gpio_147)

My apologies, I was confusing it with the DVI reset GPIO (which changed in between revisions) and the polarity of the USB pin (which changed during xM A -> C).

regards,

Koen

#4 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

In reply to Govindraj.R
Quoted 4 lines · Govindraj.R

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

OK, but you should also be clear that this patch is effectively disabling all UARTS (except UART3) by defatul, which I'm not sure all Beagle users will be happy about.

Quoted 5 lines

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

As Koen mentioned, this conflict only exists on certain boards, so you should be clear that this is just an example.

Quoted 5 lines

[...]

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+static inline void board_serial_init(void)

Should be __init

[...]

Quoted 1 line

+static inline void board_serial_init(void)

here too.

Kevin

maintainer
#5 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

Quoted 11 lines · Kevin Hilman
Quoted 4 lines · Govindraj.R

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

OK, but you should also be clear that this patch is effectively disabling all UARTS (except UART3) by defatul, which I'm not sure all Beagle users will be happy about.

Quoted 8 lines
Quoted 5 lines

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

As Koen mentioned, this conflict only exists on certain boards, so you should be clear that this is just an example.

OK, thanks for the comments. Also it's a bit clear if this really is safe to do on all beagles.

Quoted 13 lines
Quoted 5 lines

[...]

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+static inline void board_serial_init(void)

Should be __init

Quoted 5 lines

[...]

Quoted 1 line

+static inline void board_serial_init(void)

here too.

..so dropping the patch for now until these are fixed and we have some tested-bys for non-xm beagles too.

Regards,

Tony

#6 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

Quoted 18 lines · Tony Lindgren
Quoted 17 lines · Kevin Hilman
Quoted 4 lines · Govindraj.R

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

OK, but you should also be clear that this patch is effectively disabling all UARTS (except UART3) by defatul, which I'm not sure all Beagle users will be happy about.

Quoted 5 lines

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

Quoted 5 lines
Quoted 2 lines

As Koen mentioned, this conflict only exists on certain boards, so you should be clear that this is just an example.

OK, thanks for the comments. Also it's a bit clear if this really is safe to do on all beagles.

I have clarified the same in reply to "Kevin Hilman" and "Koen Kooi" in the same thread.

Quoted 14 lines
Quoted 14 lines
Quoted 6 lines

[...]

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+static inline void board_serial_init(void)

Should be __init

Quoted 9 lines
Quoted 5 lines

[...]

Quoted 1 line

+static inline void board_serial_init(void)

here too.

..so dropping the patch for now until these are fixed and we have some tested-bys for non-xm beagles too.

Okay fine, I have new version of the patch "[PATCH] omap3_beagle: init uart2 for beagle rev AX/BX only"

This patch shouldn't have any impact and should work on beagles.

--
Thanks,
Govindraj.R

#7 lore raw

PATCH 1/1 omap3_beagle: Init only uart3 used for console

In reply to Kevin Hilman
Quoted 11 lines · Kevin Hilman
Quoted 4 lines · Govindraj.R

From: "Govindraj.R" <[email protected]>

On beagle some of uart mux lines are used for other purpose so init only uart3.

OK, but you should also be clear that this patch is effectively disabling all UARTS (except UART3) by defatul, which I'm not sure all Beagle users will be happy about.

Okay, I have posted new version of the patch "[PATCH] omap3_beagle: init uart2 for beagle rev AX/BX only"

which initialises uart1/3/4 on all beagle boards

and uart2 init is done for only beagle rev ax/bx
which doesn't seem to have external usb module.

Quoted 9 lines
Quoted 5 lines

Uart2 rx line clashes with gpio_147 used for usb ehci phy reset. Initializing uart2 pad_mux lines can break ehci module on beagle xm.
(gpio_147 is available on uart2_rx in mode4 reference mux34xx.c -> uart2_rx.gpio_147)

As Koen mentioned, this conflict only exists on certain boards, so you should be clear that this is just an example.

conflict exists all beagle rev's expect rev ax/bx.

--
Thanks,
Govindraj.R