Skip to contentSkip to conversation

OMAP3: Various: Future-proof serial platdata

PATCH Superseded Adam Ford 2 participants 7 messages Mar 1, 2016 – Mar 3, 2016

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

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.

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.

---
 board/isee/igep00x0/igep00x0.c      | 6 +++---
 board/logicpd/omap3som/omap3logic.c | 6 +++---
 board/logicpd/zoom1/zoom1.c         | 6 +++---
 board/overo/overo.c                 | 6 +++---
 board/quipos/cairo/cairo.c          | 6 +++---
 board/ti/beagle/beagle.c            | 6 +++---
 board/timll/devkit8000/devkit8000.c | 6 +++---
 7 files changed, 21 insertions(+), 21 deletions(-)
board/isee/igep00x0/igep00x0.c +3 -3
index e2fce50..d1a6a6f 100644
@@ -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) = {
board/logicpd/omap3som/omap3logic.c +3 -3
index 668f684..51d2987 100644
@@ -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) = {
board/logicpd/zoom1/zoom1.c +3 -3
index 4040114..982619c 100644
@@ -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) = {
board/overo/overo.c +3 -3
index a38b959..40f13e5 100644
@@ -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) = {
board/quipos/cairo/cairo.c +3 -3
index 21793e8..77e4482 100644
@@ -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) = {
board/ti/beagle/beagle.c +3 -3
index ff317ef..0ed4f52 100644
@@ -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) = {
board/timll/devkit8000/devkit8000.c +3 -3
index 1a447c7..965252f 100644
@@ -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) = {
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

Quoted 19 lines · Adam Ford

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.

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.

Quoted 8 lines
---
 board/isee/igep00x0/igep00x0.c      | 6 +++---
 board/logicpd/omap3som/omap3logic.c | 6 +++---
 board/logicpd/zoom1/zoom1.c         | 6 +++---
 board/overo/overo.c                 | 6 +++---
 board/quipos/cairo/cairo.c          | 6 +++---
 board/ti/beagle/beagle.c            | 6 +++---
 board/timll/devkit8000/devkit8000.c | 6 +++---

Looks to me like you didn't catch all boards out there. I don't think it makes sense to limit yourself to OMAP3, otherwise different boards (that people may not realize are broken that fast) break next time...

arch/arm/cpu/arm926ejs/lpc32xx/devices.c
arch/arm/cpu/armv7/am33xx/board.c
arch/arm/mach-tegra/board.c
board/isee/igep00x0/igep00x0.c
board/lge/sniper/sniper.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

Alex

author
#2 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

I can only test OMAP3, and I tried to state that in the patch. I grepped for the platdata structure and not that manu boards aooeared. I didn't want to just fix the board that affects me, but I didn't want to go beyond the platform for fear of breaking something and not being able to test it.

Quoted 54 lines · Alexander Graf
Quoted 1 line · Adam Ford

A few boards still use ns16550_platdata structures, but assume the

structure

Quoted 6 lines

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

Quoted 1 line

board. Appologies if I missed one or stepped on toes. Thanks to Derald

Woods

Quoted 7 lines

and Alexander Graf.

V4: Fix subject heading

V3: Remove reg_offset out in all the structs. It was reverted out, and

and if

Quoted 4 lines

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.

Quoted 8 lines
---
 board/isee/igep00x0/igep00x0.c      | 6 +++---
 board/logicpd/omap3som/omap3logic.c | 6 +++---
 board/logicpd/zoom1/zoom1.c         | 6 +++---
 board/overo/overo.c                 | 6 +++---
 board/quipos/cairo/cairo.c          | 6 +++---
 board/ti/beagle/beagle.c            | 6 +++---
 board/timll/devkit8000/devkit8000.c | 6 +++---

Looks to me like you didn't catch all boards out there. I don't think it makes sense to limit yourself to OMAP3, otherwise different boards (that people may not realize are broken that fast) break next time...

arch/arm/cpu/arm926ejs/lpc32xx/devices.c
arch/arm/cpu/armv7/am33xx/board.c
arch/arm/mach-tegra/board.c
board/isee/igep00x0/igep00x0.c
board/lge/sniper/sniper.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

Alex

#3 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

Quoted 5 lines · Adam Ford

I can only test OMAP3, and I tried to state that in the patch. I grepped for the platdata structure and not that manu boards aooeared. I didn't want to just fix the board that affects me, but I didn't want to go beyond the platform for fear of breaking something and not being able to test it.

I think in this case the change is simple enough that code review should catch issues quickly.

I really don't think it's a good idea to convert 80% of the code base and leave 20% for some random point in time later. It's a great recipe for disaster :). Let's just get rid of all unnamed struct field initializers for the serial port and call it a day.

Alex

author
#4 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

In reply to Alexander Graf
Quoted 31 lines · Alexander Graf
Quoted 19 lines · Adam Ford

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.

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.

Quoted 8 lines
---
 board/isee/igep00x0/igep00x0.c      | 6 +++---
 board/logicpd/omap3som/omap3logic.c | 6 +++---
 board/logicpd/zoom1/zoom1.c         | 6 +++---
 board/overo/overo.c                 | 6 +++---
 board/quipos/cairo/cairo.c          | 6 +++---
 board/ti/beagle/beagle.c            | 6 +++---
 board/timll/devkit8000/devkit8000.c | 6 +++---
Quoted 5 lines

Looks to me like you didn't catch all boards out there. I don't think it makes sense to limit yourself to OMAP3, otherwise different boards (that people may not realize are broken that fast) break next time...

arch/arm/cpu/arm926ejs/lpc32xx/devices.c

I will fix and CC its maintainer.

Quoted 1 line

arch/arm/cpu/armv7/am33xx/board.c

These boards already have a pending patch from TI.

Quoted 1 line

arch/arm/mach-tegra/board.c

Already in git master.

Quoted 1 line

board/isee/igep00x0/igep00x0.c

I my patch

Quoted 1 line

board/lge/sniper/sniper.c

Already in git master

Quoted 6 lines

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

The rest should have all been included in my original patch, so I think they are addressed. Does that address your concern? If so, I'll push another revision that adds arch/arm/cpu/arm926ejs/lpc32xx/devices.c.

adam

Quoted 3 lines

Alex

#5 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

Quoted 62 lines

Am 02.03.2016 um 12:29 schrieb Adam Ford <[email protected]>:

Quoted 32 lines · Alexander Graf
Quoted 23 lines · Adam Ford

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.

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.
---

Quoted 7 lines
board/isee/igep00x0/igep00x0.c      | 6 +++---
board/logicpd/omap3som/omap3logic.c | 6 +++---
board/logicpd/zoom1/zoom1.c         | 6 +++---
board/overo/overo.c                 | 6 +++---
board/quipos/cairo/cairo.c          | 6 +++---
board/ti/beagle/beagle.c            | 6 +++---
board/timll/devkit8000/devkit8000.c | 6 +++---
Quoted 5 lines

Looks to me like you didn't catch all boards out there. I don't think it makes sense to limit yourself to OMAP3, otherwise different boards (that people may not realize are broken that fast) break next time...

arch/arm/cpu/arm926ejs/lpc32xx/devices.c

I will fix and CC its maintainer.

Quoted 1 line

arch/arm/cpu/armv7/am33xx/board.c

These boards already have a pending patch from TI.

Quoted 1 line

arch/arm/mach-tegra/board.c

Already in git master.

Quoted 1 line

board/isee/igep00x0/igep00x0.c

I my patch

Quoted 1 line

board/lge/sniper/sniper.c

Already in git master

Quoted 6 lines

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

Quoted 4 lines

The rest should have all been included in my original patch, so I think they are addressed. Does that address your concern? If so, I'll push another revision that adds arch/arm/cpu/arm926ejs/lpc32xx/devices.c.

Yes, thanks a lot!

Alex

author
#6 lore raw

PATCH v4 1/1 OMAP3: Various: Future-proof serial platdata

Quoted 10 lines · Alexander Graf
Quoted 10 lines

Am 02.03.2016 um 12:29 schrieb Adam Ford <[email protected]>:

Quoted 5 lines · Alexander Graf
Quoted 4 lines · Adam Ford

A few boards still use ns16550_platdata structures, but assume the

structure

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Tested on the Logic PD Torpedo + Wireless.

I only changed a handful of devices that used the same syntax as the

Logic

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

board. Appologies if I missed one or stepped on toes. Thanks to

Derald Woods

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

and Alexander Graf.

V4: Fix subject heading

V3: Remove reg_offset out in all the structs. It was reverted out,

and and if

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

it did exist, it would get initialized to 0 by default.

V2: I hastily copy-pasted the boards without looking at the UART

number.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

This addresses 3 boards that use UART3 and not UART1.
---

board/isee/igep00x0/igep00x0.c      | 6 +++---
board/logicpd/omap3som/omap3logic.c | 6 +++---
board/logicpd/zoom1/zoom1.c         | 6 +++---
board/overo/overo.c                 | 6 +++---
board/quipos/cairo/cairo.c          | 6 +++---
board/ti/beagle/beagle.c            | 6 +++---
board/timll/devkit8000/devkit8000.c | 6 +++---

Looks to me like you didn't catch all boards out there. I don't think

it

Quoted 1 line
Quoted 1 line
Quoted 1 line

makes sense to limit yourself to OMAP3, otherwise different boards

(that

Quoted 24 lines
Quoted 24 lines
Quoted 3 lines

people may not realize are broken that fast) break next time...

arch/arm/cpu/arm926ejs/lpc32xx/devices.c

I will fix and CC its maintainer.

Quoted 1 line

arch/arm/cpu/armv7/am33xx/board.c

These boards already have a pending patch from TI.

Quoted 1 line

arch/arm/mach-tegra/board.c

Already in git master.

Quoted 1 line

board/isee/igep00x0/igep00x0.c

I my patch

Quoted 1 line

board/lge/sniper/sniper.c

Already in git master

Quoted 6 lines

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

Quoted 6 lines
Quoted 4 lines

The rest should have all been included in my original patch, so I think they are addressed. Does that address your concern? If so, I'll push another revision that adds arch/arm/cpu/arm926ejs/lpc32xx/devices.c.

Yes, thanks a lot!

No problem. After discussing it with Mugunthan, I will add the am33xx into the patch, but I won't be able to get to it until this weekend. My house is undergoing some minor updates at the moment and I can use the computer.

Quoted 3 lines

Alex