* [PATCH master 2/3] ARM: rpi: look up emmc2bus by alias for dma-ranges fixup
2026-10-15 8:48 [PATCH master 1/3] ARM: rockchip: rk3568-qnap-ts433eu: re-enable combphy0, disable sata2 Ahmad Fatoum
@ 2026-10-15 8:48 ` Ahmad Fatoum
2026-10-15 8:48 ` [PATCH master 3/3] of: base: use default bus match table when populating /firmware Ahmad Fatoum
2026-10-15 11:36 ` [PATCH master 1/3] ARM: rockchip: rk3568-qnap-ts433eu: re-enable combphy0, disable sata2 Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-10-15 8:48 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
From: Ahmad Fatoum <a.fatoum@barebox.org>
The VideoCore firmware patches the dma-ranges of the eMMC2 bus to match
the BCM2711 stepping (B0 vs. C0). It finds the node via the emmc2bus
alias. Commit 3f9788433919 ("raspi: add a fixup for the `dma-ranges`
property of the `/emmc2bus` dt node") propagates that value into the
DT passed to the OS, but it looks the node up by the hardcoded path
/emmc2bus in the VideoCore DT and then creates/overwrites the node at
the same path in the DT being fixed up.
Linux commit 929dc5b3e06c ("ARM: dts: broadcom: bcm2711: Fix
'simple-bus' node names"), which came in with commit fe223ba39321
("dts: update to v7.0-rc1"), renamed /emmc2bus to /emmc2-bus@fe000000.
Since then, booting with barebox' internal DT and a firmware DT that
still uses the old name (any DT older than Linux v7.0) adds a stray
/emmc2bus node holding the dma-ranges, while the real bus keeps the
hardcoded B0 ranges.
Look up the node via the emmc2bus alias in both trees like the firmware
does, so the fixup works irrespective of the node name, and don't create
the node in the target DT if the alias is missing.
Fixes: 3f9788433919 ("raspi: add a fixup for the `dma-ranges` property of the `/emmc2bus` dt node")
Fixes: fe223ba39321 ("dts: update to v7.0-rc1")
Assisted-by: Claude:opus-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
arch/arm/boards/raspberry-pi/rpi-common.c | 31 ++++++++++++++++++-----
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index fe0b11efad68..e0a4438d54e0 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -61,8 +61,9 @@ struct rpi_priv {
};
struct rpi_property_fixup_data {
- const struct device_node* vc_node;
- const char *propname;
+ const struct device_node* vc_node;
+ const char *propname;
+ const char *alias;
};
static void rpi_set_usbethaddr(void)
@@ -314,9 +315,23 @@ static int rpi_vc_fdt_fixup_property(struct device_node *root, void *data)
struct device_node *node;
struct property *prop;
- node = of_create_node(root, fixup->vc_node->full_name);
- if (!node)
- return -ENOMEM;
+ if (fixup->alias) {
+ /*
+ * The node name need not be the same in the VideoCore FDT
+ * and in the DT we fix up (e.g. /emmc2bus was renamed to
+ * /emmc2-bus@fe000000 in Linux v7.0), so look it up via
+ * the alias like the firmware does and don't create it.
+ */
+ node = of_find_node_by_alias(root, fixup->alias);
+ if (!node) {
+ pr_debug("no '%s' alias found in fdt\n", fixup->alias);
+ return 0;
+ }
+ } else {
+ node = of_create_node(root, fixup->vc_node->full_name);
+ if (!node)
+ return -ENOMEM;
+ }
prop = of_find_property(fixup->vc_node, fixup->propname, NULL);
if (!prop)
@@ -332,13 +347,15 @@ static int register_vc_property_fixup(struct device_node *root,
struct device_node *node, *tmp;
struct rpi_property_fixup_data* fixup_data;
- node = of_find_node_by_path_from(root, path);
+ node = of_find_node_by_path_or_alias(root, path);
if (node) {
tmp = of_dup(node);
tmp->full_name = xstrdup(node->full_name);
fixup_data = xzalloc(sizeof(*fixup_data));
fixup_data->vc_node = tmp;
fixup_data->propname = xstrdup(propname);
+ if (*path != '/')
+ fixup_data->alias = xstrdup(path);
of_register_fixup(rpi_vc_fdt_fixup_property, fixup_data);
} else {
@@ -377,7 +394,7 @@ static void rpi_vc_fdt_parse(struct device_node *root)
register_vc_property_fixup(root, "/reserved-memory/nvram@0", "reg");
register_vc_property_fixup(root, "/reserved-memory/nvram@0", "status");
register_vc_fixup(root, "/hat");
- register_vc_property_fixup(root, "/emmc2bus", "dma-ranges");
+ register_vc_property_fixup(root, "emmc2bus", "dma-ranges");
register_vc_fixup(root, "/chosen/bootloader");
chosen = register_vc_fixup(root, "/chosen");
if (!chosen) {
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH master 3/3] of: base: use default bus match table when populating /firmware
2026-10-15 8:48 [PATCH master 1/3] ARM: rockchip: rk3568-qnap-ts433eu: re-enable combphy0, disable sata2 Ahmad Fatoum
2026-10-15 8:48 ` [PATCH master 2/3] ARM: rpi: look up emmc2bus by alias for dma-ranges fixup Ahmad Fatoum
@ 2026-10-15 8:48 ` Ahmad Fatoum
2026-10-15 11:36 ` [PATCH master 1/3] ARM: rockchip: rk3568-qnap-ts433eu: re-enable combphy0, disable sata2 Sascha Hauer
2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-10-15 8:48 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
From: Ahmad Fatoum <a.fatoum@barebox.org>
This is an adoption of the corresponding Linux commit:
| commit 48e6a9c4a20870e09f85ff1a3628275d6bce31c0
| Author: Rob Herring (Arm) <robh@kernel.org>
| AuthorDate: Tue Jan 13 19:51:58 2026 -0600
|
| of: platform: Use default match table for /firmware
|
| Calling of_platform_populate() without a match table will only populate
| the immediate child nodes under /firmware. This is usually fine, but in
| the case of something like a "simple-mfd" node such as
| "raspberrypi,bcm2835-firmware", those child nodes will not be populated.
| And subsequent calls won't work either because the /firmware node is
| marked as processed already.
|
| Switch the call to of_platform_default_populate() to solve this problem.
| It should be a nop for existing cases.
|
| Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
| Cc: stable@vger.kernel.org
| Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
| Link: https://patch.msgid.link/20260114015158.692170-2-robh@kernel.org
| Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This change becomes necessary with the dts sync to Linux v7.1-rc1 in
commit 9eb4ad3c0b8c ("dts: update to v7.1-rc1"), which pulled in Linux
commits:
- 5e3bfd609ffd ("ARM: dts: broadcom: bcm2835-rpi: Move non simple-bus nodes
to root level")
- 0acb1de2b4df ("arm64: dts: broadcom: bcm2712: Move non simple-bus nodes to
root level").
On all Raspberry Pi device trees the "raspberrypi,bcm2835-firmware", "simple-mfd"
node moved from /soc/firmware (below a simple-bus, populated recursively) to
/firmware/rpi-firmware. Its clocks, power, gpio and reset children are
no longer populated.
Fixes: cb667b97c663 ("of: populate "/firmware" while populating device tree")
Assisted-by: Claude:opus-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
drivers/of/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 194888359345..81aa69391692 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -3034,7 +3034,7 @@ int of_probe(void)
node = of_find_node_by_path("/firmware");
if (node)
- of_platform_populate(node, NULL, NULL);
+ of_platform_populate(node, of_default_bus_match_table, NULL);
of_platform_populate(root_node, of_default_bus_match_table, NULL);
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread