]> git.sur5r.net Git - u-boot/commitdiff
tegra: add alternate UART1 funcmux entry
authorStephen Warren <swarren@nvidia.com>
Mon, 14 May 2012 13:13:45 +0000 (13:13 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:17 +0000 (14:07 +0200)
(In at least some configurations) Whistler uses UART1 on pingroups
UAA, UAB.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/armv7/tegra2/board.c
arch/arm/cpu/armv7/tegra2/funcmux.c
arch/arm/include/asm/arch-tegra2/funcmux.h

index a50b1b988a23d1ced00f360ba1d1c03b17006ca7..629ad5d67f89db55e68147decca994d5415b67ae 100644 (file)
@@ -101,6 +101,18 @@ int arch_cpu_init(void)
 }
 #endif
 
+static int uart_configs[] = {
+#ifdef CONFIG_TEGRA2_UARTA_UAA_UAB
+       FUNCMUX_UART1_UAA_UAB,
+#else
+       FUNCMUX_UART1_IRRX_IRTX,
+#endif
+       FUNCMUX_UART2_IRDA,
+       -1,
+       FUNCMUX_UART4_GMC,
+       -1,
+};
+
 /**
  * Set up the specified uarts
  *
@@ -120,7 +132,7 @@ static void setup_uarts(int uart_ids)
                if (uart_ids & (1 << i)) {
                        enum periph_id id = id_for_uart[i];
 
-                       funcmux_select(id, FUNCMUX_DEFAULT);
+                       funcmux_select(id, uart_configs[i]);
                        clock_ll_start_uart(id);
                }
        }
index 0ef775302188a57b178e9f0ed78a3310fcc4b38e..e2d1273dc91e9ee7a868d289b1e81aac8271310c 100644 (file)
@@ -31,11 +31,22 @@ int funcmux_select(enum periph_id id, int config)
 
        switch (id) {
        case PERIPH_ID_UART1:
-               if (config == FUNCMUX_UART1_IRRX_IRTX) {
+               switch (config) {
+               case FUNCMUX_UART1_IRRX_IRTX:
                        pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
                        pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
                        pinmux_tristate_disable(PINGRP_IRRX);
                        pinmux_tristate_disable(PINGRP_IRTX);
+                       break;
+               case FUNCMUX_UART1_UAA_UAB:
+                       pinmux_set_func(PINGRP_UAA, PMUX_FUNC_UARTA);
+                       pinmux_set_func(PINGRP_UAB, PMUX_FUNC_UARTA);
+                       pinmux_tristate_disable(PINGRP_UAA);
+                       pinmux_tristate_disable(PINGRP_UAB);
+                       bad_config = 0;
+                       break;
+               }
+               if (!bad_config) {
                        /*
                         * Tegra appears to boot with function UARTA pre-
                         * selected on mux group SDB. If two mux groups are
index ae73c72ebe20c317f2951f740c5d621f54af492e..b455122594de3351697f52fa6583cae64f5cf250 100644 (file)
@@ -30,6 +30,7 @@ enum {
 
        /* UART configs */
        FUNCMUX_UART1_IRRX_IRTX = 0,
+       FUNCMUX_UART1_UAA_UAB,
        FUNCMUX_UART2_IRDA = 0,
        FUNCMUX_UART4_GMC = 0,