[U-Boot] [PATCH 1/2] fdt: Allow indicating a node is for U-Boot proper only
Patrick Delaunay
patrick.delaunay at st.com
Mon Feb 4 10:14:51 UTC 2019
This add missing parts for previous commit 06f94461a9f4
("fdt: Allow indicating a node is for U-Boot proper only")
At present it is not possible to specify that a node should be used before
relocation (in U-Boot proper) without it also ending up in SPL and TPL
device trees. Add a new "u-boot,dm-pre-proper" boolean property for this.
Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---
Hi,
I create this patch, after testing the new key "u-boot,dm-pre-proper"
for ltdc VIDEO driver on stm32mp1 board. I try to replace the
previous used "u-boot,dm-pre-reloc".
/* pre-reloc probe = reserve video frame buffer in video_reserve() */
<dc {
- u-boot,dm-pre-reloc;
+ u-boot,dm-pre-proper;
};
And it is failing.
NB: preloc support is only needed in video uclass to reserved
the frame buffer(called by board_f), so the node for video
u-class driver is only used in U-BOOT pre-relocation and not in SPL.
After a grep in code, I see that the initial patch don't add the support of
the new "u-boot,dm-pre-proper" in all location where
"u-boot,dm-pre-reloc" was tested.
When I add the needed test in util.c, it is working.
drivers/core/util.c | 4 ++++
drivers/video/video-uclass.c | 4 +++-
include/dm/ofnode.h | 6 ++++--
include/dm/util.h | 12 ++++++++----
4 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/core/util.c b/drivers/core/util.c
index 27a6848..6bedc8a 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -35,6 +35,8 @@ bool dm_fdt_pre_reloc(const void *blob, int offset)
{
if (fdt_getprop(blob, offset, "u-boot,dm-pre-reloc", NULL))
return true;
+ if (fdt_getprop(blob, offset, "u-boot,dm-pre-proper", NULL))
+ return true;
#ifdef CONFIG_TPL_BUILD
if (fdt_getprop(blob, offset, "u-boot,dm-tpl", NULL))
@@ -59,6 +61,8 @@ bool dm_ofnode_pre_reloc(ofnode node)
{
if (ofnode_read_bool(node, "u-boot,dm-pre-reloc"))
return true;
+ if (ofnode_read_bool(node, "u-boot,dm-pre-proper"))
+ return true;
#ifdef CONFIG_TPL_BUILD
if (ofnode_read_bool(node, "u-boot,dm-tpl"))
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index f307cf2..a9d40fe 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -290,7 +290,9 @@ static int video_post_bind(struct udevice *dev)
return 0;
size = alloc_fb(dev, &addr);
if (addr < gd->video_bottom) {
- /* Device tree node may need the 'u-boot,dm-pre-reloc' tag */
+ /* Device tree node may need the 'u-boot,dm-pre-reloc' or
+ * 'u-boot,dm-pre-proper' tag
+ */
printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n",
dev->name);
return -ENOSPC;
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index d206ee2..b45da5e 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -662,12 +662,14 @@ int ofnode_read_simple_size_cells(ofnode node);
* After relocation and jumping into the real U-Boot binary it is possible to
* determine if a node was bound in one of SPL/TPL stages.
*
- * There are 3 settings currently in use
- * -
+ * There are 4 settings currently in use
+ * - u-boot,dm-pre-proper: U-Boot proper pre-relocation only
* - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL
* Existing platforms only use it to indicate nodes needed in
* SPL. Should probably be replaced by u-boot,dm-spl for
* new platforms.
+ * - u-boot,dm-spl: SPL and U-Boot pre-relocation
+ * - u-boot,dm-tpl: TPL and U-Boot pre-relocation
*
* @node: node to check
* @return true if node is needed in SPL/TL, false otherwise
diff --git a/include/dm/util.h b/include/dm/util.h
index 9ff6531..cbc209d 100644
--- a/include/dm/util.h
+++ b/include/dm/util.h
@@ -52,12 +52,14 @@ static inline void dm_dump_devres(void)
* it is possible to determine if a node was bound in one of
* SPL/TPL stages.
*
- * There are 3 settings currently in use
- * -
+ * There are 4 settings currently in use
+ * - u-boot,dm-pre-proper: U-Boot proper pre-relocation only
* - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL
* Existing platforms only use it to indicate nodes needed in
* SPL. Should probably be replaced by u-boot,dm-spl for
* existing platforms.
+ * - u-boot,dm-spl: SPL and U-Boot pre-relocation
+ * - u-boot,dm-tpl: TPL and U-Boot pre-relocation
* @blob: devicetree
* @offset: node offset
*
@@ -78,12 +80,14 @@ bool dm_fdt_pre_reloc(const void *blob, int offset);
* it is possible to determine if a node was bound in one of
* SPL/TPL stages.
*
- * There are 3 settings currently in use
- * -
+ * There are 4 settings currently in use
+ * - u-boot,dm-pre-proper: U-Boot proper pre-relocation only
* - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL
* Existing platforms only use it to indicate nodes needed in
* SPL. Should probably be replaced by u-boot,dm-spl for
* existing platforms.
+ * - u-boot,dm-spl: SPL and U-Boot pre-relocation
+ * - u-boot,dm-tpl: TPL and U-Boot pre-relocation
* @node: of node
*
* Returns true if node is needed in SPL/TL, false otherwise.
--
2.7.4
More information about the U-Boot
mailing list