[PATCH 42/67] upl: Set bit 32 of the address when using ISA

Simon Glass sjg at chromium.org
Wed Jan 1 23:09:28 CET 2025


The convention is to set bit 32 to indicate an I/O access. Do this when
using an ISA serial port.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 boot/upl_common.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/boot/upl_common.c b/boot/upl_common.c
index b0246f72597..a5a1da9cb57 100644
--- a/boot/upl_common.c
+++ b/boot/upl_common.c
@@ -62,7 +62,7 @@ int upl_add_serial(struct upl_serial *ser)
 {
 	struct udevice *dev = gd->cur_serial_dev;
 	struct serial_device_info info;
-	struct memregion region;
+	u64 addr;
 	int ret;
 
 	if (!dev)
@@ -74,10 +74,13 @@ int upl_add_serial(struct upl_serial *ser)
 	ser->compatible = ofnode_read_string(dev_ofnode(dev), "compatible");
 	ser->clock_frequency = info.clock;
 	ser->current_speed = info.baudrate;
-	region.base = info.addr;
-	region.size = info.size;
-	if (!alist_add(&ser->reg, region))
-		return -ENOMEM;
+
+	/* Set bit 32 of the address if using I/O */
+	addr = info.addr;
+	if (info.addr_space == SERIAL_ADDRESS_SPACE_IO)
+		addr |= BIT_ULL(32);
+	ret = upl_add_region(&ser->reg, addr, info.size);
+
 	ser->reg_io_shift = info.reg_shift;
 	ser->reg_offset = info.reg_offset;
 	ser->reg_io_width = info.reg_width;
-- 
2.43.0



More information about the U-Boot mailing list