]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ARM: Various: Future-proof serial platdata
authorAdam Ford <aford173@gmail.com>
Tue, 8 Mar 2016 03:08:49 +0000 (21:08 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 14 Mar 2016 23:18:48 +0000 (19:18 -0400)
A few boards still use ns16550_platdata structures, but assume the structure
is going to be in a specific order. By explicitly naming each entry,
this should also help 'future-proof' in the event the structure changes.

Tested on the Logic PD Torpedo + Wireless.

I only changed a handful of devices that used the same syntax as the Logic
board.  Appologies if I missed one or stepped on toes.  Thanks to Derald Woods
and Alexander Graf.

Signed-off-by: Adam Ford <aford173@gmail.com>
V6: Add fix to arch/arm/cpu/armv7/am33xx/board.c

V5: Add fix to arch/arm/cpu/arm926ejs/lpc32xx/devices.c

V4: Fix subject heading

V3: Remove  reg_offset out in all the structs. It was reverted out, and and if
it did exist, it would get initialized to 0 by default.

V2: I hastily copy-pasted the boards without looking at the UART number.
This addresses 3 boards that use UART3 and not UART1.
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/cpu/arm926ejs/lpc32xx/devices.c
arch/arm/cpu/armv7/am33xx/board.c
board/isee/igep00x0/igep00x0.c
board/logicpd/omap3som/omap3logic.c
board/logicpd/zoom1/zoom1.c
board/overo/overo.c
board/quipos/cairo/cairo.c
board/ti/beagle/beagle.c
board/timll/devkit8000/devkit8000.c

index b6db23e981fbd69f5f3cb91cbde60983ef4f1513..399b07c5420ab2b4cecab4f0a3dd4232011fe9d4 100644 (file)
@@ -45,10 +45,10 @@ void lpc32xx_uart_init(unsigned int uart_id)
 
 #if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct ns16550_platdata lpc32xx_uart[] = {
-       { UART3_BASE, 2, CONFIG_SYS_NS16550_CLK },
-       { UART4_BASE, 2, CONFIG_SYS_NS16550_CLK },
-       { UART5_BASE, 2, CONFIG_SYS_NS16550_CLK },
-       { UART6_BASE, 2, CONFIG_SYS_NS16550_CLK },
+       { .base = UART3_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = UART4_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = UART5_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = UART6_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
 };
 
 #if defined(CONFIG_LPC32XX_HSUART)
index e8d5be32b4b7b5ddcbcc2a288875b37718023033..a99cbf9de05fd6205a7d4ebbf7449bc8db2f98b7 100644 (file)
@@ -40,14 +40,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct ns16550_platdata am33xx_serial[] = {
-       { CONFIG_SYS_NS16550_COM1, 2, CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
 # ifdef CONFIG_SYS_NS16550_COM2
-       { CONFIG_SYS_NS16550_COM2, 2, CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
 #  ifdef CONFIG_SYS_NS16550_COM3
-       { CONFIG_SYS_NS16550_COM3, 2, CONFIG_SYS_NS16550_CLK },
-       { CONFIG_SYS_NS16550_COM4, 2, CONFIG_SYS_NS16550_CLK },
-       { CONFIG_SYS_NS16550_COM5, 2, CONFIG_SYS_NS16550_CLK },
-       { CONFIG_SYS_NS16550_COM6, 2, CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+       { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
 #  endif
 # endif
 };
index e2fce5020804fd9ec32f752ba47ead6ac1f93ff9..d1a6a6f56f0211da5f8424ca95d64783150f661e 100644 (file)
@@ -34,9 +34,9 @@ static const u32 gpmc_lan_config[] = {
 #endif
 
 static const struct ns16550_platdata igep_serial = {
-       OMAP34XX_UART3,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(igep_uart) = {
index 668f68476e681a7373cba5338b129a9fe517ad69..51d298756644672fe718befebc18650890e8c5cf 100644 (file)
@@ -47,9 +47,9 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 
 static const struct ns16550_platdata omap3logic_serial = {
-       OMAP34XX_UART1,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART1,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(omap3logic_uart) = {
index 4040114ce0aaa761cdb819dd4870e95675510ef4..982619cd7bc7af4443d8305af462dc8bd9b2e7fc 100644 (file)
@@ -44,9 +44,9 @@ static const u32 gpmc_lab_enet[] = {
 };
 
 static const struct ns16550_platdata zoom1_serial = {
-       OMAP34XX_UART3,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(zoom1_uart) = {
index a38b959cb24f5c619d8a12d360766f354a3c9a6a..40f13e5876cc40683f6e54d544336b9271187a54 100644 (file)
@@ -68,9 +68,9 @@ static struct {
 } expansion_config = {0x0};
 
 static const struct ns16550_platdata overo_serial = {
-       OMAP34XX_UART3,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(overo_uart) = {
index 21793e85c4df7620e15f23c843e6cac7289a34fb..77e4482906f075cfeadc7e640d763e109381a028 100644 (file)
@@ -91,9 +91,9 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
 #endif
 
 static const struct ns16550_platdata cairo_serial = {
-       OMAP34XX_UART2,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART2,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(cairo_uart) = {
index ff317efc2c75de39a88f32b39c7d45a81753ab6a..0ed4f527715794778810848256e3655376d309ac 100644 (file)
@@ -73,9 +73,9 @@ static struct {
 } expansion_config;
 
 static const struct ns16550_platdata beagle_serial = {
-       OMAP34XX_UART3,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(beagle_uart) = {
index 1a447c77df21203e169147a3680817d0226f6071..965252f18df4f9051e4b65b815739e741be1b58a 100644 (file)
@@ -46,9 +46,9 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = {
 };
 
 static const struct ns16550_platdata devkit8000_serial = {
-       OMAP34XX_UART3,
-       2,
-       V_NS16550_CLK
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK
 };
 
 U_BOOT_DEVICE(devkit8000_uart) = {