[PATCH 3/8] ARM: am33xx: Make uart0 mux init callable during early init

Sascha Hauer s.hauer at pengutronix.de
Thu Aug 22 16:36:54 EDT 2013


The am33xx pinmux functions use global variables which are not
accessible during early init. To make the setup of an early debug
uart easier convert am33xx_enable_uart0_pin_mux to not use global
variables.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-omap/am33xx_mux.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index 8318713..e92bc27 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -21,12 +21,6 @@
 #define MUX_CFG(value, offset)	\
 	__raw_writel(value, (AM33XX_CTRL_BASE + offset));
 
-static const __maybe_unused struct module_pin_mux uart0_pin_mux[] = {
-	{OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},	/* UART0_RXD */
-	{OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},		/* UART0_TXD */
-	{-1},
-};
-
 static const __maybe_unused struct module_pin_mux uart2_pin_mux[] = {
 	{OFFSET(mii1_txclk), (MODE(1) | PULLUDEN | RXACTIVE)},	/* UART2_RXD */
 	{OFFSET(mii1_rxclk), (MODE(1) | PULLUDEN)},		/* UART2_TXD */
@@ -299,7 +293,12 @@ void am33xx_enable_i2c2_pin_mux(void)
 
 void am33xx_enable_uart0_pin_mux(void)
 {
-	configure_module_pin_mux(uart0_pin_mux);
+	/*
+	 * no global variables for UART to make this callable
+	 * during early init.
+	 */
+	MUX_CFG((MODE(0) | PULLUP_EN | RXACTIVE), OFFSET(uart0_rxd));
+	MUX_CFG((MODE(0) | PULLUDEN), OFFSET(uart0_txd));
 }
 
 void am33xx_enable_uart2_pin_mux(void)
-- 
1.8.4.rc3




More information about the barebox mailing list