* [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
@ 2026-07-01 7:50 ` Paresh Bhagat
2026-07-02 15:13 ` Andrew Davis
2026-07-08 4:02 ` Neha Malcom Francis
2026-07-01 7:50 ` [PATCH v2 2/4] arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2 Paresh Bhagat
` (4 subsequent siblings)
5 siblings, 2 replies; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-01 7:50 UTC (permalink / raw)
To: u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
Fix phandle corruption in fdt_fixup_reserved_memory()
The original implementation used a delete/recreate approach:
- Find existing reserved memory node (e.g. tfa@80000000)
- Delete the entire node with fdt_del_node()
- Create new node with fdtdec_add_reserved_memory()
This worked fine for ATF and OPTEE nodes because no other device tree
nodes reference them via phandles but other nodes example DM are
referenced by R5 nodes.
If these nodes are deleted and recreated, it will not have any phandle
property but the nodes referencing it will still contain the old
phandle, causing initialization to fail.
Update nodes in-place instead of delete/recreate to update only the
"reg" property using fdt_setprop().
Fixes: 8b0fc29de0e3 ("arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT")
Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
---
arch/arm/mach-k3/common_fdt.c | 31 +++++++------------------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
index 39cb00c3f43..4b833f5fabe 100644
--- a/arch/arm/mach-k3/common_fdt.c
+++ b/arch/arm/mach-k3/common_fdt.c
@@ -119,7 +119,6 @@ static int fdt_fixup_reserved_memory(void *blob, const char *name,
unsigned int new_size)
{
int nodeoffset, subnode;
- int ret;
struct fdt_memory carveout = {
.start = new_address,
};
@@ -129,43 +128,27 @@ static int fdt_fixup_reserved_memory(void *blob, const char *name,
if (nodeoffset < 0)
goto add_carveout;
- /* Find existing matching subnode and remove it */
+ /* Find existing matching subnode and update it in place */
fdt_for_each_subnode(subnode, blob, nodeoffset) {
const char *node_name;
- fdt_addr_t addr;
- fdt_size_t size;
+ u64 reg[2];
/* Name matching */
node_name = fdt_get_name(blob, subnode, NULL);
if (!name)
return -EINVAL;
if (!strncmp(node_name, name, strlen(name))) {
- /* Read out old size first */
- addr = fdtdec_get_addr_size_auto_parent(
- blob, nodeoffset, subnode, "reg", 0, &size,
- false);
- if (addr == FDT_ADDR_T_NONE)
- return -EINVAL;
- new_size = size;
-
- /* Delete node */
- ret = fdt_del_node(blob, subnode);
- if (ret < 0)
- return ret;
-
- /* Only one matching node */
- break;
+ /* Update the reg property in place */
+ reg[0] = cpu_to_fdt64(new_address);
+ reg[1] = cpu_to_fdt64(new_size);
+ return fdt_setprop(blob, subnode, "reg", reg, sizeof(reg));
}
}
add_carveout:
carveout.end = new_address + new_size - 1;
- ret = fdtdec_add_reserved_memory(blob, name, &carveout, NULL, 0, NULL,
+ return fdtdec_add_reserved_memory(blob, name, &carveout, NULL, 0, NULL,
FDTDEC_RESERVED_MEMORY_NO_MAP);
- if (ret < 0)
- return ret;
-
- return 0;
}
int fdt_fixup_reserved(void *blob)
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup
2026-07-01 7:50 ` [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup Paresh Bhagat
@ 2026-07-02 15:13 ` Andrew Davis
2026-07-08 4:02 ` Neha Malcom Francis
1 sibling, 0 replies; 14+ messages in thread
From: Andrew Davis @ 2026-07-02 15:13 UTC (permalink / raw)
To: Paresh Bhagat, u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, m-chawdhry,
joao.goncalves, bb, n-francis, sebin.francis
On 7/1/26 2:50 AM, Paresh Bhagat wrote:
> Fix phandle corruption in fdt_fixup_reserved_memory()
>
> The original implementation used a delete/recreate approach:
> - Find existing reserved memory node (e.g. tfa@80000000)
> - Delete the entire node with fdt_del_node()
> - Create new node with fdtdec_add_reserved_memory()
>
> This worked fine for ATF and OPTEE nodes because no other device tree
> nodes reference them via phandles but other nodes example DM are
> referenced by R5 nodes.
>
> If these nodes are deleted and recreated, it will not have any phandle
> property but the nodes referencing it will still contain the old
> phandle, causing initialization to fail.
>
> Update nodes in-place instead of delete/recreate to update only the
> "reg" property using fdt_setprop().
>
> Fixes: 8b0fc29de0e3 ("arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT")
>
> Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
> ---
> arch/arm/mach-k3/common_fdt.c | 31 +++++++------------------------
> 1 file changed, 7 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
> index 39cb00c3f43..4b833f5fabe 100644
> --- a/arch/arm/mach-k3/common_fdt.c
> +++ b/arch/arm/mach-k3/common_fdt.c
> @@ -119,7 +119,6 @@ static int fdt_fixup_reserved_memory(void *blob, const char *name,
> unsigned int new_size)
> {
> int nodeoffset, subnode;
> - int ret;
> struct fdt_memory carveout = {
> .start = new_address,
> };
> @@ -129,43 +128,27 @@ static int fdt_fixup_reserved_memory(void *blob, const char *name,
> if (nodeoffset < 0)
> goto add_carveout;
>
> - /* Find existing matching subnode and remove it */
> + /* Find existing matching subnode and update it in place */
> fdt_for_each_subnode(subnode, blob, nodeoffset) {
> const char *node_name;
> - fdt_addr_t addr;
> - fdt_size_t size;
> + u64 reg[2];
>
> /* Name matching */
> node_name = fdt_get_name(blob, subnode, NULL);
> if (!name)
> return -EINVAL;
> if (!strncmp(node_name, name, strlen(name))) {
> - /* Read out old size first */
> - addr = fdtdec_get_addr_size_auto_parent(
> - blob, nodeoffset, subnode, "reg", 0, &size,
> - false);
> - if (addr == FDT_ADDR_T_NONE)
> - return -EINVAL;
> - new_size = size;
> -
> - /* Delete node */
> - ret = fdt_del_node(blob, subnode);
> - if (ret < 0)
> - return ret;
> -
> - /* Only one matching node */
> - break;
> + /* Update the reg property in place */
> + reg[0] = cpu_to_fdt64(new_address);
> + reg[1] = cpu_to_fdt64(new_size);
> + return fdt_setprop(blob, subnode, "reg", reg, sizeof(reg));
Note that this only updates the `reg` property, not the node name itself
which will still include the old @address. Not that it really matters though,
I'm just trying to remember why I used a delete/recreate approach here in
the first place.
This also assumes address and size cells are always 64bit (which should
always be the case, but might be good to check).
Acked-by: Andrew Davis <afd@ti.com>
> }
> }
>
> add_carveout:
> carveout.end = new_address + new_size - 1;
> - ret = fdtdec_add_reserved_memory(blob, name, &carveout, NULL, 0, NULL,
> + return fdtdec_add_reserved_memory(blob, name, &carveout, NULL, 0, NULL,
> FDTDEC_RESERVED_MEMORY_NO_MAP);
> - if (ret < 0)
> - return ret;
> -
> - return 0;
> }
>
> int fdt_fixup_reserved(void *blob)
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup
2026-07-01 7:50 ` [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup Paresh Bhagat
2026-07-02 15:13 ` Andrew Davis
@ 2026-07-08 4:02 ` Neha Malcom Francis
1 sibling, 0 replies; 14+ messages in thread
From: Neha Malcom Francis @ 2026-07-08 4:02 UTC (permalink / raw)
To: Paresh Bhagat
Cc: u-boot, trini, praneeth, vigneshr, u-kumar1, msp, v-singh1,
anshuld, afd, m-chawdhry, joao.goncalves, bb, n-francis,
sebin.francis
On Wed, 01 Jul 2026 13:20:18 +0530, Paresh Bhagat <p-bhagat@ti.com> wrote:
> Fix phandle corruption in fdt_fixup_reserved_memory()
>
> The original implementation used a delete/recreate approach:
> - Find existing reserved memory node (e.g. tfa@80000000)
> - Delete the entire node with fdt_del_node()
> - Create new node with fdtdec_add_reserved_memory()
>
> [...]
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
--
Neha Malcom Francis <n-francis@ti.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 2/4] arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
2026-07-01 7:50 ` [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup Paresh Bhagat
@ 2026-07-01 7:50 ` Paresh Bhagat
2026-07-01 7:50 ` [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs Paresh Bhagat
` (3 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-01 7:50 UTC (permalink / raw)
To: u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
Enable OF_SYSTEM_SETUP for AM62D2 to ensure FDT fixups are applied to
the dtb before passing to kernel.
Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
---
arch/arm/mach-k3/am62ax/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-k3/am62ax/Kconfig b/arch/arm/mach-k3/am62ax/Kconfig
index 6a3969343ec..e7c2a2de9be 100644
--- a/arch/arm/mach-k3/am62ax/Kconfig
+++ b/arch/arm/mach-k3/am62ax/Kconfig
@@ -54,6 +54,7 @@ config TARGET_AM62D2_A53_EVM
bool "TI K3 based AM62D2 EVM running on A53"
select ARM64
select BINMAN
+ select OF_SYSTEM_SETUP
imply BOARD
imply SPL_BOARD
imply TI_I2C_BOARD_DETECT
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
2026-07-01 7:50 ` [PATCH v2 1/4] arm: mach-k3: Fix phandle corruption in fdt fixup Paresh Bhagat
2026-07-01 7:50 ` [PATCH v2 2/4] arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2 Paresh Bhagat
@ 2026-07-01 7:50 ` Paresh Bhagat
2026-07-02 18:12 ` Andrew Davis
2026-07-01 7:50 ` [PATCH v2 4/4] arm: mach-k3: Add DM reserved memory fixup Paresh Bhagat
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-01 7:50 UTC (permalink / raw)
To: u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
Add Kconfig options for DM firmware reserved memory for K3 SOCs that
support DM firmware (K3_DM_FW enabled)
- K3_DM_FW_RESERVED_ADDR: DM firmware address
- K3_DM_FW_RESERVED_SIZE: DM firmware reserved size
These configs will be used to fixup the kernel device tree's reserved
memory node for DM. Currently the fixup is only done for AM62A7 SoC, as
K3_DM_FW_RESERVED_SIZE is being used to update DM reserved memory from
0xf0000 to 0x1f0000 as the current reserved carveout is insufficient to
accommodate the binary.
For other platforms, the addresses and sizes are based on the existing
device tree reserved memory. If needed for other SoCs, address and size
could be modified in Kconfig.
Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
---
arch/arm/mach-k3/Kconfig | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index a32ed3a9683..1b6678e72b7 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -165,6 +165,27 @@ config K3_DM_FW
bootloader, it makes RM and PM services not being available
during R5 SPL execution time.
+config K3_DM_FW_RESERVED_ADDR
+ hex "Start address of DM firmware reserved memory region"
+ depends on !SOC_K3_AM642 && !SOC_K3_AM654
+ default 0x9c900000 if SOC_K3_AM62A7 || SOC_K3_AM62P5
+ default 0x9db00000 if SOC_K3_AM625
+ default 0xa0100000 if SOC_K3_J721E || SOC_K3_J7200 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4
+ help
+ Start address of the DDR region reserved for DM firmware at runtime.
+ Used only to fixup the kernel device-tree reserved-memory node.
+
+config K3_DM_FW_RESERVED_SIZE
+ hex "Reserved memory size for DM firmware"
+ depends on !SOC_K3_AM642 && !SOC_K3_AM654
+ default 0x1f00000 if SOC_K3_AM62A7
+ default 0xc00000 if SOC_K3_AM625
+ default 0x1e00000 if TARGET_VERDIN_AM62P_A53 || TARGET_VERDIN_AM62P_R5
+ default 0xf00000 if SOC_K3_AM62P5 || SOC_K3_J721E || SOC_K3_J7200 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4
+ help
+ The runtime memory size reserved for DM firmware. This is the total
+ DDR span needed for the DM firmware binary.
+
config K3_X509_SWRV
int "SWRV for X509 certificate used for boot images"
default 1
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
2026-07-01 7:50 ` [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs Paresh Bhagat
@ 2026-07-02 18:12 ` Andrew Davis
2026-07-02 19:08 ` Francesco Dolcini
0 siblings, 1 reply; 14+ messages in thread
From: Andrew Davis @ 2026-07-02 18:12 UTC (permalink / raw)
To: Paresh Bhagat, u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, m-chawdhry,
joao.goncalves, bb, n-francis, sebin.francis
On 7/1/26 2:50 AM, Paresh Bhagat wrote:
> Add Kconfig options for DM firmware reserved memory for K3 SOCs that
> support DM firmware (K3_DM_FW enabled)
> - K3_DM_FW_RESERVED_ADDR: DM firmware address
> - K3_DM_FW_RESERVED_SIZE: DM firmware reserved size
>
> These configs will be used to fixup the kernel device tree's reserved
> memory node for DM. Currently the fixup is only done for AM62A7 SoC, as
> K3_DM_FW_RESERVED_SIZE is being used to update DM reserved memory from
> 0xf0000 to 0x1f0000 as the current reserved carveout is insufficient to
> accommodate the binary.
>
> For other platforms, the addresses and sizes are based on the existing
> device tree reserved memory. If needed for other SoCs, address and size
> could be modified in Kconfig.
>
> Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
> ---
> arch/arm/mach-k3/Kconfig | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index a32ed3a9683..1b6678e72b7 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -165,6 +165,27 @@ config K3_DM_FW
> bootloader, it makes RM and PM services not being available
> during R5 SPL execution time.
>
> +config K3_DM_FW_RESERVED_ADDR
> + hex "Start address of DM firmware reserved memory region"
> + depends on !SOC_K3_AM642 && !SOC_K3_AM654
> + default 0x9c900000 if SOC_K3_AM62A7 || SOC_K3_AM62P5
> + default 0x9db00000 if SOC_K3_AM625
> + default 0xa0100000 if SOC_K3_J721E || SOC_K3_J7200 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4
> + help
> + Start address of the DDR region reserved for DM firmware at runtime.
> + Used only to fixup the kernel device-tree reserved-memory node.
> +
> +config K3_DM_FW_RESERVED_SIZE
> + hex "Reserved memory size for DM firmware"
> + depends on !SOC_K3_AM642 && !SOC_K3_AM654
> + default 0x1f00000 if SOC_K3_AM62A7
> + default 0xc00000 if SOC_K3_AM625
> + default 0x1e00000 if TARGET_VERDIN_AM62P_A53 || TARGET_VERDIN_AM62P_R5
Why is this one board different from the rest of the AM62P boards? I doubt
the folks at Toradex have make a custom DM firmware, guessing they are just
the first to notice our default DM firmware goes outside the current reserved
memory size. This size likely needs to be made common for all AM62P.
Andrew
> + default 0xf00000 if SOC_K3_AM62P5 || SOC_K3_J721E || SOC_K3_J7200 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4
> + help
> + The runtime memory size reserved for DM firmware. This is the total
> + DDR span needed for the DM firmware binary.
> +
> config K3_X509_SWRV
> int "SWRV for X509 certificate used for boot images"
> default 1
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
2026-07-02 18:12 ` Andrew Davis
@ 2026-07-02 19:08 ` Francesco Dolcini
0 siblings, 0 replies; 14+ messages in thread
From: Francesco Dolcini @ 2026-07-02 19:08 UTC (permalink / raw)
To: Andrew Davis
Cc: Paresh Bhagat, u-boot, trini, praneeth, vigneshr, u-kumar1, msp,
v-singh1, anshuld, m-chawdhry, joao.goncalves, bb, n-francis,
sebin.francis
On Thu, Jul 02, 2026 at 01:12:08PM -0500, Andrew Davis wrote:
> On 7/1/26 2:50 AM, Paresh Bhagat wrote:
> > Add Kconfig options for DM firmware reserved memory for K3 SOCs that
> > support DM firmware (K3_DM_FW enabled)
> > - K3_DM_FW_RESERVED_ADDR: DM firmware address
> > - K3_DM_FW_RESERVED_SIZE: DM firmware reserved size
> >
> > These configs will be used to fixup the kernel device tree's reserved
> > memory node for DM. Currently the fixup is only done for AM62A7 SoC, as
> > K3_DM_FW_RESERVED_SIZE is being used to update DM reserved memory from
> > 0xf0000 to 0x1f0000 as the current reserved carveout is insufficient to
> > accommodate the binary.
> >
> > For other platforms, the addresses and sizes are based on the existing
> > device tree reserved memory. If needed for other SoCs, address and size
> > could be modified in Kconfig.
> >
> > Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
> > ---
> > arch/arm/mach-k3/Kconfig | 21 +++++++++++++++++++++
> > 1 file changed, 21 insertions(+)
> >
> > diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> > index a32ed3a9683..1b6678e72b7 100644
> > --- a/arch/arm/mach-k3/Kconfig
> > +++ b/arch/arm/mach-k3/Kconfig
> > @@ -165,6 +165,27 @@ config K3_DM_FW
> > bootloader, it makes RM and PM services not being available
> > during R5 SPL execution time.
> > +config K3_DM_FW_RESERVED_ADDR
> > + hex "Start address of DM firmware reserved memory region"
> > + depends on !SOC_K3_AM642 && !SOC_K3_AM654
> > + default 0x9c900000 if SOC_K3_AM62A7 || SOC_K3_AM62P5
> > + default 0x9db00000 if SOC_K3_AM625
> > + default 0xa0100000 if SOC_K3_J721E || SOC_K3_J7200 || SOC_K3_J721S2 || SOC_K3_J722S || SOC_K3_J784S4
> > + help
> > + Start address of the DDR region reserved for DM firmware at runtime.
> > + Used only to fixup the kernel device-tree reserved-memory node.
> > +
> > +config K3_DM_FW_RESERVED_SIZE
> > + hex "Reserved memory size for DM firmware"
> > + depends on !SOC_K3_AM642 && !SOC_K3_AM654
> > + default 0x1f00000 if SOC_K3_AM62A7
> > + default 0xc00000 if SOC_K3_AM625
> > + default 0x1e00000 if TARGET_VERDIN_AM62P_A53 || TARGET_VERDIN_AM62P_R5
>
> Why is this one board different from the rest of the AM62P boards? I doubt
> the folks at Toradex have make a custom DM firmware, guessing they are just
> the first to notice our default DM firmware goes outside the current reserved
> memory size. This size likely needs to be made common for all AM62P.
You are right, we are not customizing anything on this regard.
Francesco
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 4/4] arm: mach-k3: Add DM reserved memory fixup
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
` (2 preceding siblings ...)
2026-07-01 7:50 ` [PATCH v2 3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs Paresh Bhagat
@ 2026-07-01 7:50 ` Paresh Bhagat
2026-07-08 4:02 ` Neha Malcom Francis
2026-07-06 6:41 ` [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
2026-07-16 23:25 ` Tom Rini
5 siblings, 1 reply; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-01 7:50 UTC (permalink / raw)
To: u-boot, trini
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
Add support for fixing up DM firmware reserved memory in the kernel
device tree for K3 SoCs that use separate DM firmware.
The fixup uses the CONFIG_K3_DM_FW_RESERVED_ADDR and
CONFIG_K3_DM_FW_RESERVED_SIZE Kconfig options to update the
reserved-memory node with the correct DM firmware carveout.
Note that the fixup needs DM reserved memory node is to be renamed in
dts. Example memory@9c900000 → dm@9c900000
Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
---
arch/arm/mach-k3/common_fdt.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-k3/common_fdt.c b/arch/arm/mach-k3/common_fdt.c
index 4b833f5fabe..18f30e9d052 100644
--- a/arch/arm/mach-k3/common_fdt.c
+++ b/arch/arm/mach-k3/common_fdt.c
@@ -160,9 +160,23 @@ int fdt_fixup_reserved(void *blob)
if (ret)
return ret;
- return fdt_fixup_reserved_memory(blob, "optee",
- CONFIG_K3_OPTEE_LOAD_ADDR,
- CONFIG_K3_OPTEE_RESERVED_SIZE);
+ ret = fdt_fixup_reserved_memory(blob, "optee",
+ CONFIG_K3_OPTEE_LOAD_ADDR,
+ CONFIG_K3_OPTEE_RESERVED_SIZE);
+
+ if (ret)
+ return ret;
+
+#if defined(CONFIG_K3_DM_FW_RESERVED_ADDR) && defined(CONFIG_K3_DM_FW_RESERVED_SIZE)
+ ret = fdt_fixup_reserved_memory(blob, "dm",
+ CONFIG_K3_DM_FW_RESERVED_ADDR,
+ CONFIG_K3_DM_FW_RESERVED_SIZE);
+
+ if (ret)
+ return ret;
+#endif
+
+ return 0;
}
static int fdt_fixup_critical_trips(void *blob, int zoneoffset, int maxc)
--
2.34.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 4/4] arm: mach-k3: Add DM reserved memory fixup
2026-07-01 7:50 ` [PATCH v2 4/4] arm: mach-k3: Add DM reserved memory fixup Paresh Bhagat
@ 2026-07-08 4:02 ` Neha Malcom Francis
0 siblings, 0 replies; 14+ messages in thread
From: Neha Malcom Francis @ 2026-07-08 4:02 UTC (permalink / raw)
To: Paresh Bhagat
Cc: u-boot, trini, praneeth, vigneshr, u-kumar1, msp, v-singh1,
anshuld, afd, m-chawdhry, joao.goncalves, bb, n-francis,
sebin.francis
On Wed, 01 Jul 2026 13:20:21 +0530, Paresh Bhagat <p-bhagat@ti.com> wrote:
> Add support for fixing up DM firmware reserved memory in the kernel
> device tree for K3 SoCs that use separate DM firmware.
>
> The fixup uses the CONFIG_K3_DM_FW_RESERVED_ADDR and
> CONFIG_K3_DM_FW_RESERVED_SIZE Kconfig options to update the
> reserved-memory node with the correct DM firmware carveout.
>
> [...]
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
--
Neha Malcom Francis <n-francis@ti.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 0/4] Add DM firmware reserved memory support
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
` (3 preceding siblings ...)
2026-07-01 7:50 ` [PATCH v2 4/4] arm: mach-k3: Add DM reserved memory fixup Paresh Bhagat
@ 2026-07-06 6:41 ` Paresh Bhagat
2026-07-16 23:25 ` Tom Rini
5 siblings, 0 replies; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-06 6:41 UTC (permalink / raw)
To: trini, u-boot
Cc: p-bhagat, afd, anshuld, bb, joao.goncalves, m-chawdhry, msp,
n-francis, praneeth, sebin.francis, u-kumar1, v-singh1, vigneshr
Hi,
On 7/1/26 , Paresh Bhagat wrote:
> This series adds support for DM firmware reserved memory fixup in device
> tree for K3 SoCs that use separate DM firmware (K3_DM_FW enabled).
>
> The series includes:
> 1. Fix for phandle corruption in FDT reserved memory fixup
> 2. Enable OF_SYSTEM_SETUP for AM62D2 to allow device tree fixups
> 3. Add Kconfig options for DM firmware reserved memory for other K3 SoCs
> 4. Add DM reserved memory fixup implementation
>
> The main issue being addressed is that the current reserved DDR carveout
> for DM firmware in device tree is insufficient to accommodate the DM
> firmware binary on AM62A7, and potentially other K3 SoCs in the future.
>
> Currently, the size is only modified for AM62A7 SoC. For rest of SocS
> existing values from device tree is taken.
>
> For vendor boards, please verify boot and check for errors if any.
>
> This series depends on dts update for effected devices. If "dm" node is
> not found then the existing mechanism creates a new node with same
> address, which cause memory overlap issue.
>
This patch series conflicts with
https://lore.kernel.org/all/20260701-topic-am62a-ioddr-dt-v6-19-v7-0-e9db8b16821a@baylibre.com/
Above also includes fixes for incorrect reserved memory and new layout.
So do not merge this series. I will send a new version if required when above is merged.
Thanks,
Paresh
> https://lore.kernel.org/all/20260630150919.457160-1-p-bhagat@ti.com/
>
> Change log v1->v2:
> - Extended DM firmware reserved memory Kconfig support from AM62A7 only
> to other K3 SoCs.
> - Added memory configuration for all K3 SoCs
> - Update fdt_fixup_reserved_memory() to remove redundant code.
>
> v1
> https://lore.kernel.org/all/178219072988.1099376.16053199642199625548.b4-review@b4/
>
> Paresh Bhagat (4):
> arm: mach-k3: Fix phandle corruption in fdt fixup
> arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2
> arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
> arm: mach-k3: Add DM reserved memory fixup
>
> arch/arm/mach-k3/Kconfig | 21 ++++++++++++++
> arch/arm/mach-k3/am62ax/Kconfig | 1 +
> arch/arm/mach-k3/common_fdt.c | 51 ++++++++++++++++-----------------
> 3 files changed, 46 insertions(+), 27 deletions(-)
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 0/4] Add DM firmware reserved memory support
2026-07-01 7:50 [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
` (4 preceding siblings ...)
2026-07-06 6:41 ` [PATCH v2 0/4] Add DM firmware reserved memory support Paresh Bhagat
@ 2026-07-16 23:25 ` Tom Rini
2026-07-17 6:41 ` Paresh Bhagat
5 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2026-07-16 23:25 UTC (permalink / raw)
To: u-boot, Paresh Bhagat
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
On Wed, 01 Jul 2026 13:20:17 +0530, Paresh Bhagat wrote:
> This series adds support for DM firmware reserved memory fixup in device
> tree for K3 SoCs that use separate DM firmware (K3_DM_FW enabled).
>
> The series includes:
> 1. Fix for phandle corruption in FDT reserved memory fixup
> 2. Enable OF_SYSTEM_SETUP for AM62D2 to allow device tree fixups
> 3. Add Kconfig options for DM firmware reserved memory for other K3 SoCs
> 4. Add DM reserved memory fixup implementation
>
> [...]
Applied to u-boot/main, thanks!
[1/4] arm: mach-k3: Fix phandle corruption in fdt fixup
commit: d3e287405f0a0f9683f9c6c49e84495ea18d9f01
[2/4] arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2
commit: f16e4c80040c2d5186ad3cfa83c469b26adbd46f
[3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
commit: 5e2be9f5ccc4ca3c9cd326d4671a853b783adcae
[4/4] arm: mach-k3: Add DM reserved memory fixup
commit: 0cceea6e449888f4422e674e7157696d382eb686
--
Tom
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 0/4] Add DM firmware reserved memory support
2026-07-16 23:25 ` Tom Rini
@ 2026-07-17 6:41 ` Paresh Bhagat
2026-07-17 16:16 ` Tom Rini
0 siblings, 1 reply; 14+ messages in thread
From: Paresh Bhagat @ 2026-07-17 6:41 UTC (permalink / raw)
To: Tom Rini, u-boot
Cc: praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
Hi Tom,
On 17/07/26 04:55, Tom Rini wrote:
> On Wed, 01 Jul 2026 13:20:17 +0530, Paresh Bhagat wrote:
>
>> This series adds support for DM firmware reserved memory fixup in device
>> tree for K3 SoCs that use separate DM firmware (K3_DM_FW enabled).
>>
>> The series includes:
>> 1. Fix for phandle corruption in FDT reserved memory fixup
>> 2. Enable OF_SYSTEM_SETUP for AM62D2 to allow device tree fixups
>> 3. Add Kconfig options for DM firmware reserved memory for other K3 SoCs
>> 4. Add DM reserved memory fixup implementation
>>
>> [...]
> Applied to u-boot/main, thanks!
If possible could we revert this patch?
This series conflicts from one other series and needs changes in
approach how to fixup the DM reserved memory region.
If this is merged without the corresponding device tree changes to
include "dm", there will be a new node with same region causing memory
overlap.
Please refer to this:
https://lore.kernel.org/all/20260706064104.138000-1-p-bhagat@ti.com/
Thanks,
Paresh
>
> [1/4] arm: mach-k3: Fix phandle corruption in fdt fixup
> commit: d3e287405f0a0f9683f9c6c49e84495ea18d9f01
> [2/4] arm: mach-k3: am62ax: Enable OF_SYSTEM_SETUP for AM62D2
> commit: f16e4c80040c2d5186ad3cfa83c469b26adbd46f
> [3/4] arm: mack-k3: Kconfig: Add DM firmware reserved memory configs
> commit: 5e2be9f5ccc4ca3c9cd326d4671a853b783adcae
> [4/4] arm: mach-k3: Add DM reserved memory fixup
> commit: 0cceea6e449888f4422e674e7157696d382eb686
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/4] Add DM firmware reserved memory support
2026-07-17 6:41 ` Paresh Bhagat
@ 2026-07-17 16:16 ` Tom Rini
0 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2026-07-17 16:16 UTC (permalink / raw)
To: Paresh Bhagat
Cc: u-boot, praneeth, vigneshr, u-kumar1, msp, v-singh1, anshuld, afd,
m-chawdhry, joao.goncalves, bb, n-francis, sebin.francis
[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]
On Fri, Jul 17, 2026 at 12:11:21PM +0530, Paresh Bhagat wrote:
> Hi Tom,
>
> On 17/07/26 04:55, Tom Rini wrote:
> > On Wed, 01 Jul 2026 13:20:17 +0530, Paresh Bhagat wrote:
> >
> > > This series adds support for DM firmware reserved memory fixup in device
> > > tree for K3 SoCs that use separate DM firmware (K3_DM_FW enabled).
> > >
> > > The series includes:
> > > 1. Fix for phandle corruption in FDT reserved memory fixup
> > > 2. Enable OF_SYSTEM_SETUP for AM62D2 to allow device tree fixups
> > > 3. Add Kconfig options for DM firmware reserved memory for other K3 SoCs
> > > 4. Add DM reserved memory fixup implementation
> > >
> > > [...]
> > Applied to u-boot/main, thanks!
>
>
> If possible could we revert this patch?
> This series conflicts from one other series and needs changes in approach
> how to fixup the DM reserved memory region.
> If this is merged without the corresponding device tree changes to include
> "dm", there will be a new node with same region causing memory overlap.
> Please refer to this:
> https://lore.kernel.org/all/20260706064104.138000-1-p-bhagat@ti.com/
Sorry I had missed that, reverted. I will note that if you register with
patchwork you should be able to manage the status of your own patches at
least.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread