mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 3/3] simplefb-fixup: add reserved memory-region entry for the simple-framebuffer
Date: Mon, 17 Nov 2025 22:29:28 +0100	[thread overview]
Message-ID: <20251117-simplefb-fixup-v1-3-7824d99b3fb3@pengutronix.de> (raw)
In-Reply-To: <20251117-simplefb-fixup-v1-0-7824d99b3fb3@pengutronix.de>

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




  parent reply	other threads:[~2025-11-17 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 21:29 [PATCH 0/3] simplefb-fixup: fixes for 64bit systems Michael Grzeschik
2025-11-17 21:29 ` [PATCH 1/3] include: linux: ioport.h: port resource_set_range from linux Michael Grzeschik
2025-11-17 21:29 ` [PATCH 2/3] simplefb-fixup: depend res fields on root size-cells and addr-cells Michael Grzeschik
2025-11-17 21:29 ` Michael Grzeschik [this message]
2025-11-18  7:30 ` [PATCH 0/3] simplefb-fixup: fixes for 64bit systems Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251117-simplefb-fixup-v1-3-7824d99b3fb3@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox