Skip to contentSkip to conversation

serial: ns16550: Correct the base address type

PATCH New Bin Meng 2 participants 5 messages Feb 3, 2021 – Feb 26, 2021

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 serial: ns16550: Correct the base address type

Currently ns16550_serial_assign_base() treats the argument 'base' with type ulong. This is incorrect because the base address was obtained from device tree with type fdt_addr_t that can represent a physical address larger than 32-bit in a 32-bit system.

Fixes 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")

---

 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/ns16550.c +1 -1
index 65c6db0..da903c1 100644
@@ -482,7 +482,7 @@ static int ns16550_serial_getinfo(struct udevice *dev,
 	return 0;
 }
 
-static int ns16550_serial_assign_base(struct ns16550_plat *plat, ulong base)
+static int ns16550_serial_assign_base(struct ns16550_plat *plat, fdt_addr_t base)
 {
 	if (base == FDT_ADDR_T_NONE)
 		return -EINVAL;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 serial: ns16550: Correct the base address type

Quoted 6 lines · Bin Meng

Currently ns16550_serial_assign_base() treats the argument 'base' with type ulong. This is incorrect because the base address was obtained from device tree with type fdt_addr_t that can represent a physical address larger than 32-bit in a 32-bit system.

Quoted 6 lines
Fixes 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")

---

 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 serial: ns16550: Correct the base address type

Quoted 6 lines · Bin Meng

Currently ns16550_serial_assign_base() treats the argument 'base' with type ulong. This is incorrect because the base address was obtained from device tree with type fdt_addr_t that can represent a physical address larger than 32-bit in a 32-bit system.

Quoted 6 lines
Fixes 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")

---

 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

author
#3 lore raw

PATCH 1/1 serial: ns16550: Correct the base address type

Hi Simon,

Quoted 12 lines · Simon Glass
Quoted 10 lines · Bin Meng

Currently ns16550_serial_assign_base() treats the argument 'base' with type ulong. This is incorrect because the base address was obtained from device tree with type fdt_addr_t that can represent a physical address larger than 32-bit in a 32-bit system.

Fixes 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")

---

Quoted 6 lines
Quoted 2 lines
 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

It looks like this is still not in u-boot/master yet?

Regards,
Bin

#4 lore raw

PATCH 1/1 serial: ns16550: Correct the base address type

Hi Bin,

Quoted 16 lines · Bin Meng

Hi Simon,

Quoted 12 lines · Simon Glass
Quoted 10 lines · Bin Meng

Currently ns16550_serial_assign_base() treats the argument 'base' with type ulong. This is incorrect because the base address was obtained from device tree with type fdt_addr_t that can represent a physical address larger than 32-bit in a 32-bit system.

Fixes 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")

---

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
 drivers/serial/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

It looks like this is still not in u-boot/master yet?

Yes we hit a snag as Tom wants the of-platdata stuff in -next instead. I'll make a note to mess around with dm/master a bit and send a pull request with just a few fixes, including this one.

Regards,
Simon