[PATCH 41/67] upl: Use a 64-bit value for a memregion base-address

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


With 32-bit machines sometimes a 64-bit address needs to be provided.
For example, ISA I/O access is indicated by setting bit 32 of the base
address.

Update the existing type to use 64 bits and drop the 0x prefix on unit
addresses.

Fix a 'nennap' typo while here.

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

 boot/upl_write.c | 6 +++---
 include/upl.h    | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/boot/upl_write.c b/boot/upl_write.c
index c53fa5396e8..c2bb3187803 100644
--- a/boot/upl_write.c
+++ b/boot/upl_write.c
@@ -315,7 +315,7 @@ static int write_mem_node(const struct upl *upl, ofnode parent,
 		return log_msg_ret("reg", -EINVAL);
 	}
 	first = alist_get(mem, 0, struct memregion);
-	sprintf(name, "%s at 0x%lx", leaf, first->base);
+	sprintf(name, "%s@%llx", leaf, first->base);
 	ret = ofnode_add_subnode(parent, name, &node);
 	if (ret)
 		return log_msg_ret("wmn", ret);
@@ -466,7 +466,7 @@ static int add_upl_serial(const struct upl *upl, ofnode root,
 	if (!ser->reg.count)
 		return log_msg_ret("ser", -EINVAL);
 	first = alist_get(&ser->reg, 0, struct memregion);
-	sprintf(name, UPLN_SERIAL "@0x%lx", first->base);
+	sprintf(name, UPLN_SERIAL "@%llx", first->base);
 	ret = ofnode_add_subnode(root, name, &node);
 	if (ret)
 		return log_msg_ret("img", ret);
@@ -526,7 +526,7 @@ static int add_upl_graphics(const struct upl *upl, ofnode root)
 	if (!gra->reg.count)
 		return log_msg_ret("gra", -ENOENT);
 	first = alist_get(&gra->reg, 0, struct memregion);
-	sprintf(name, UPLN_GRAPHICS "@0x%lx", first->base);
+	sprintf(name, UPLN_GRAPHICS "@%llx", first->base);
 	ret = ofnode_add_subnode(root, name, &node);
 	if (ret)
 		return log_msg_ret("gra", ret);
diff --git a/include/upl.h b/include/upl.h
index ce357d16ebe..aef23ad8e8e 100644
--- a/include/upl.h
+++ b/include/upl.h
@@ -14,6 +14,7 @@
 #include <alist.h>
 #include <image.h>
 #include <dm/ofnode_decl.h>
+#include <asm/types.h>
 
 struct unit_test_state;
 
@@ -111,7 +112,7 @@ struct upl_image {
  * @size: Size in bytes
  */
 struct memregion {
-	ulong base;
+	u64 base;
 	ulong size;
 };
 
@@ -254,8 +255,8 @@ struct upl_graphics {
  * @acpi_nvs_size: Size of the ACPI non-volatile-storage area in bytes
  * @image: Information about each image (struct upl_image)
  * @mem: Information about physical-memory regions (struct upl_mem)
- * @nennap: Information about logical-memory regions (struct upl_memmap)
- * @nennap: Information about reserved-memory regions (struct upl_memres)
+ * @menmap: Information about logical-memory regions (struct upl_memmap)
+ * @memres: Information about reserved-memory regions (struct upl_memres)
  */
 struct upl {
 	int addr_cells;
-- 
2.43.0



More information about the U-Boot mailing list