[PATCH 3/3] simplefb-fixup: add reserved memory-region entry for the simple-framebuffer
Michael Grzeschik
m.grzeschik at pengutronix.de
Mon Nov 17 13:29:28 PST 2025
The modern way to describe an reserved memory region is to place an
entry in the reserved-memory nodes. Using the of_fixup_reserved_memory
this is simply done.
Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
---
drivers/video/simplefb-fixup.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/video/simplefb-fixup.c b/drivers/video/simplefb-fixup.c
index 9b39e1ef46d84eed61242119251d340b44d59a6e..e20f2922445bddcb13a049b2581c4c632289d6ee 100644
--- a/drivers/video/simplefb-fixup.c
+++ b/drivers/video/simplefb-fixup.c
@@ -13,6 +13,7 @@
#include <fb.h>
#include <fcntl.h>
#include <fs.h>
+#include <of.h>
#include <init.h>
#include <xfuncs.h>
@@ -93,6 +94,7 @@ static int simplefb_create_node(struct device_node *root,
phys_addr_t screen_base;
__be32 cells[4];
int addr_cells = 2, size_cells = 1, ret;
+ struct resource res = { };
of_property_read_u32(root, "#address-cells", &addr_cells);
of_property_read_u32(root, "#size-cells", &size_cells);
@@ -121,6 +123,12 @@ static int simplefb_create_node(struct device_node *root,
if (ret < 0)
return ret;
+ res.name = "simple-framebuffer";
+ res.flags |= IORESOURCE_BUSY;
+ resource_set_range(&res, screen_base, fbi->screen_size);
+
+ of_fixup_reserved_memory(root, &res);
+
cells[0] = cpu_to_be32(fbi->xres);
ret = of_set_property(node, "width", cells, sizeof(cells[0]), 1);
if (ret < 0)
@@ -140,8 +148,6 @@ static int simplefb_create_node(struct device_node *root,
if (ret < 0)
return ret;
- of_add_reserve_entry(screen_base, screen_base + fbi->screen_size);
-
return of_property_write_string(node, "status", "okay");
}
--
2.47.3
More information about the barebox
mailing list