Skip to contentSkip to conversation

arm: am335x: add Kconfig range attribute to prevent invalid CONS_INDEX

PATCH In review Masahiro Yamada 2 participants 3 messages Aug 31, 2014 – Sep 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: am335x: add Kconfig range attribute to prevent invalid CONS_INDEX

The help message in board/ti/am335x/Kconfig says AM335x has 6 UARTs, so the valid number for CONFIG_CONS_INDEX is from 1 to 6.

---

BTW, why does CONFIG_CONS_INDEX start from 1, not 0.

CONFIG_CONS_INDEX=1 correponds to UART0 ?

 board/ti/am335x/Kconfig | 1 +
 1 file changed, 1 insertion(+)
board/ti/am335x/Kconfig +1 -0
index 0e5149c..80701f5 100644
@@ -22,6 +22,7 @@ config SYS_CONFIG_NAME
 
 config CONS_INDEX
 	int "UART used for console"
+	range 1 6
 	default 1
 	help
 	  The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 arm: am335x: add Kconfig range attribute to prevent invalid CONS_INDEX

Quoted 10 lines · Masahiro Yamada

The help message in board/ti/am335x/Kconfig says AM335x has 6 UARTs, so the valid number for CONFIG_CONS_INDEX is from 1 to 6.

---

BTW, why does CONFIG_CONS_INDEX start from 1, not 0.

CONFIG_CONS_INDEX=1 correponds to UART0 ?

CONFIG_CONS_INDEX is 1-based, AM33xx TRM has UARTs 0-based, so yes, we map things as you're thinking.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140831/812539ef/attachment.pgp>
#2 lore raw
In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

The help message in board/ti/am335x/Kconfig says AM335x has 6 UARTs, so the valid number for CONFIG_CONS_INDEX is from 1 to 6.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140904/16d510d8/attachment.pgp>