[U-Boot] [PATCH] am335x_evm: Convert CONFIG_CONS_INDEX into a menu choice

2014-08-01 Thread Tom Rini
- Drop CONFIG_SERIAL[1-6] and use CONFIG_CONS_INDEX tests instead
- Add choice and help text to board/ti/am335x/Kconfig
- Correct comment about IDK in board/ti/am335x/mux.c
- Remove am335x_evm_uart* defconfig files as they're just variations
  on a config option now.

Signed-off-by: Tom Rini tr...@ti.com
---
 board/ti/am335x/Kconfig  |9 +
 board/ti/am335x/board.c  |   19 +++
 board/ti/am335x/mux.c|7 +--
 configs/am335x_evm_defconfig |3 ++-
 configs/am335x_evm_nor_defconfig |3 ++-
 configs/am335x_evm_norboot_defconfig |3 ++-
 configs/am335x_evm_spiboot_defconfig |3 ++-
 configs/am335x_evm_uart1_defconfig   |4 
 configs/am335x_evm_uart2_defconfig   |4 
 configs/am335x_evm_uart3_defconfig   |4 
 configs/am335x_evm_uart4_defconfig   |4 
 configs/am335x_evm_uart5_defconfig   |4 
 configs/am335x_evm_usbspl_defconfig  |3 ++-
 13 files changed, 27 insertions(+), 43 deletions(-)
 delete mode 100644 configs/am335x_evm_uart1_defconfig
 delete mode 100644 configs/am335x_evm_uart2_defconfig
 delete mode 100644 configs/am335x_evm_uart3_defconfig
 delete mode 100644 configs/am335x_evm_uart4_defconfig
 delete mode 100644 configs/am335x_evm_uart5_defconfig

diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig
index c3b61af2..0e5149c 100644
--- a/board/ti/am335x/Kconfig
+++ b/board/ti/am335x/Kconfig
@@ -20,4 +20,13 @@ config SYS_CONFIG_NAME
string
default am335x_evm
 
+config CONS_INDEX
+   int UART used for console
+   default 1
+   help
+ The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
+ in documentation, etc) available to it.  Depending on your specific
+ board you may want something other than UART0 as for example the IDK
+ uses UART3 so enter 4 here.
+
 endif
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index d81eec9..0739e60 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -383,24 +383,19 @@ const struct dpll_params *get_dpll_ddr_params(void)
 
 void set_uart_mux_conf(void)
 {
-#ifdef CONFIG_SERIAL1
+#if CONFIG_CONS_INDEX == 1
enable_uart0_pin_mux();
-#endif /* CONFIG_SERIAL1 */
-#ifdef CONFIG_SERIAL2
+#elif CONFIG_CONS_INDEX == 2
enable_uart1_pin_mux();
-#endif /* CONFIG_SERIAL2 */
-#ifdef CONFIG_SERIAL3
+#elif CONFIG_CONS_INDEX == 3
enable_uart2_pin_mux();
-#endif /* CONFIG_SERIAL3 */
-#ifdef CONFIG_SERIAL4
+#elif CONFIG_CONS_INDEX == 4
enable_uart3_pin_mux();
-#endif /* CONFIG_SERIAL4 */
-#ifdef CONFIG_SERIAL5
+#elif CONFIG_CONS_INDEX == 5
enable_uart4_pin_mux();
-#endif /* CONFIG_SERIAL5 */
-#ifdef CONFIG_SERIAL6
+#elif CONFIG_CONS_INDEX == 6
enable_uart5_pin_mux();
-#endif /* CONFIG_SERIAL6 */
+#endif
 }
 
 void set_mux_conf_regs(void)
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index b2bfda5..3fdbedf 100644
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -358,12 +358,7 @@ void enable_board_pin_mux(struct am335x_baseboard_id 
*header)
configure_module_pin_mux(spi0_pin_mux);
}
} else if (board_is_idk(header)) {
-   /*
-* Industrial Motor Control (IDK)
-* note: IDK console is on UART3 by default.
-*   So u-boot mus be build with CONFIG_SERIAL4 and
-*   CONFIG_CONS_INDEX=4
-*/
+   /* Industrial Motor Control (IDK) */
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_no_cd_pin_mux);
} else if (board_is_evm_sk(header)) {
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 7710dc0..2e5aeaa 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -1,4 +1,5 @@
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS=SERIAL1,CONS_INDEX=1,NAND
+CONFIG_SYS_EXTRA_OPTIONS=NAND
+CONFIG_CONS_INDEX=1
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_AM335X_EVM=y
diff --git a/configs/am335x_evm_nor_defconfig b/configs/am335x_evm_nor_defconfig
index fecec5e..2e5aeaa 100644
--- a/configs/am335x_evm_nor_defconfig
+++ b/configs/am335x_evm_nor_defconfig
@@ -1,4 +1,5 @@
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS=SERIAL1,CONS_INDEX=1,NAND,NOR
+CONFIG_SYS_EXTRA_OPTIONS=NAND
+CONFIG_CONS_INDEX=1
 +S:CONFIG_ARM=y
 +S:CONFIG_TARGET_AM335X_EVM=y
diff --git a/configs/am335x_evm_norboot_defconfig 
b/configs/am335x_evm_norboot_defconfig
index 6005c22..872a493 100644
--- a/configs/am335x_evm_norboot_defconfig
+++ b/configs/am335x_evm_norboot_defconfig
@@ -1,3 +1,4 @@
-CONFIG_SYS_EXTRA_OPTIONS=SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT
+CONFIG_SYS_EXTRA_OPTIONS=NAND
+CONFIG_CONS_INDEX=1
 CONFIG_ARM=y
 CONFIG_TARGET_AM335X_EVM=y
diff --git a/configs/am335x_evm_spiboot_defconfig 
b/configs/am335x_evm_spiboot_defconfig
index 389d1d8..2e5aeaa 100644
--- 

Re: [U-Boot] [PATCH] am335x_evm: Convert CONFIG_CONS_INDEX into a menu choice

2014-08-01 Thread Tom Rini
On Fri, Aug 01, 2014 at 09:36:54AM -0400, Tom Rini wrote:

 - Drop CONFIG_SERIAL[1-6] and use CONFIG_CONS_INDEX tests instead
 - Add choice and help text to board/ti/am335x/Kconfig
 - Correct comment about IDK in board/ti/am335x/mux.c
 - Remove am335x_evm_uart* defconfig files as they're just variations
   on a config option now.
[snip]
 diff --git a/configs/am335x_evm_norboot_defconfig 
 b/configs/am335x_evm_norboot_defconfig
 index 6005c22..872a493 100644
 --- a/configs/am335x_evm_norboot_defconfig
 +++ b/configs/am335x_evm_norboot_defconfig
 @@ -1,3 +1,4 @@
 -CONFIG_SYS_EXTRA_OPTIONS=SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT
 +CONFIG_SYS_EXTRA_OPTIONS=NAND

Regex gone wild here, oops, V2 shortly.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot