dts: ti: k3-j7: Reserve memory for LPM metadata
Subsystems (3)
v4 cover dts: ti: k3-j7: Reserve memory for LPM metadata
For TI Jacinto SoCs (J7200, J721S2, J784S4, J722S, J742S2) which support low power modes, a chunk of memory is reserved for LPM metadata, needed for saving ATF context and the certificate information of ATF and OPTEE and the DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
At boot time, U-Boot R5 SPL copies the DM image into this memory region so that it doesn't have to be reloaded from storage at resume, speeding up the resume time.
U-Boot R5 SPL/TIFS use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
NB: Unlike for Sitara, this memory region is not part of the DM memory, which is not retained across suspend, so the Sitara binding can't be re-used here.
Patch 1 adds a new binding for this layout.
Patch 2 skips the firewalled lpm-metadata memory region
The other patches add the memory region for the TI Jacinto SoCs (J7200, J721S2, J784S4, J722S, J742S2)
Changes since v3:
- rebase on v7.3-rc4
- skip mapping the firewalled lpm-metadata memory region
Link to v3: https://lore.kernel.org/lkml/[email protected]/
Changes since v2:
- Split the DTS changes per ipc-firmware.dtsi
- Reference the LPM carveout through a phandle
- Add a dt-bindings patch documenting the "lpm-metadata" memory-region
name for the Jacinto layout.
- Use the generic @memory node naming instead of @lpm-memory.
- Clarify how the DM image is handled
Link to v2: https://lore.kernel.org/lkml/[email protected]/
Changes since v1:
- add specific lpm region for j742s2 and j784s4 instead of the common one since the addresses are not the same.
- add j721s2 lpm_memory_region
- change j722s addresse to prevent holes
Link to v1: https://lore.kernel.org/lkml/[email protected]/
Richard Genoud (TI) (7):
dt-bindings: remoteproc: k3-r5f: Add Jacinto LPM memory region
remoteproc: k3: skip mapping firewalled lpm-metadata memory region
arm64: dts: ti: k3-j7200-ti-ipc-firmware: Reserve memory for LPM
metadata
arm64: dts: ti: k3-j721s2-ti-ipc-firmware: Reserve memory for LPM
metadata
arm64: dts: ti: k3-j784s4-ti-ipc-firmware: Reserve memory for LPM
metadata
arm64: dts: ti: k3-j722s-ti-ipc-firmware: Reserve memory for LPM
metadata
arm64: dts: ti: k3-j742s2-ti-ipc-firmware: Reserve memory for LPM
metadata
.../bindings/remoteproc/ti,k3-r5f-rproc.yaml | 18 ++++++++-- .../boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi | 12 +++++-- .../dts/ti/k3-j721s2-ti-ipc-firmware.dtsi | 12 +++++-- .../boot/dts/ti/k3-j722s-ti-ipc-firmware.dtsi | 12 +++++-- arch/arm64/boot/dts/ti/k3-j742s2-evm.dts | 2 ++ .../dts/ti/k3-j742s2-ti-ipc-firmware.dtsi | 24 +++++++++++++ .../dts/ti/k3-j784s4-ti-ipc-firmware.dtsi | 15 ++++++++ drivers/remoteproc/ti_k3_common.c | 36 +++++++++++++------ 8 files changed, 111 insertions(+), 20 deletions(-) create mode 100644 arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi
base-commit: 93f51579e7df248780214094418f205253383cc5
PATCH v4 1/7 dt-bindings: remoteproc: k3-r5f: Add Jacinto LPM memory region
Declare a carveout memory region to store LPM metadata on Jacinto devices.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- .../bindings/remoteproc/ti,k3-r5f-rproc.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml +15 -3
@@ -155,9 +155,10 @@ patternProperties: description: | phandle to the reserved memory nodes to be associated with the remoteproc device. There should be two reserved memory nodes defined - for the basic layout or 6 partitions for a detailed layout. The - reserved memory nodes should be carveout nodes, and should be defined - with a "no-map" property as per the bindings in + for the basic layout, three for the Jacinto layout or 6 partitions + for a detailed layout. The reserved memory nodes should be carveout + nodes, and should be defined with a "no-map" property as per the + bindings in Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt oneOf: - description: Basic layout
@@ -174,6 +175,12 @@ patternProperties: - description: LPM metadata - description: LPM FS context data and reserved sections - description: DM RM/PM trace and firmware code/data + - description: Jacinto layout + items: + - description: region used for dynamic DMA allocations like vrings and + vring buffers + - description: region reserved for firmware image sections + - description: LPM metadata memory-region-names: description: |
@@ -192,6 +199,11 @@ patternProperties: - const: lpm-metadata - const: lpm-context - const: dm-firmware + - description: Jacinto layout + items: + - const: dma + - const: firmware + - const: lpm-metadata # Optional properties: # --------------------
Re: [PATCH v4 1/7] dt-bindings: remoteproc: k3-r5f: Add Jacinto LPM memory region
Quoted 25 lines · Richard Genoud (TI)
Declare a carveout memory region to store LPM metadata on Jacinto devices.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DMhttps://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
Quoted 8 lines
NB: This memory region is not part of DM memory (which is not retained at suspend)
Signed-off-by Richard Genoud (TI) <[email protected]>--- .../bindings/remoteproc/ti,k3-r5f-rproc.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
PATCH v4 2/7 remoteproc: k3: skip mapping firewalled lpm-metadata memory region
In reply to Richard Genoud (TI)The region lpm-metadata is firewalled by TIFS on Jacinto devices, so it should not be mapped to prevent speculative access crashes
Just skip this memory region during initialization.
--- drivers/remoteproc/ti_k3_common.c | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-)
drivers/remoteproc/ti_k3_common.c +25 -11
@@ -471,7 +471,7 @@ int k3_reserved_mem_init(struct k3_rproc *kproc)struct device *dev = kproc->dev;struct device_node *np = dev->of_node;int num_rmems; -int ret, i; +int ret, i, j; num_rmems =of_reserved_mem_region_count (np);if (num_rmems <0 ) {
@@ -501,30 +501,44 @@ int k3_reserved_mem_init(struct k3_rproc *kproc)return -ENOMEM ;/* use remaining reserved memory regions for static carveouts */ -for (i =0 ; i < num_rmems; i++) { +for (j =0 , i =0 ; i < num_rmems; i++) {struct resource res; +const char *region_name; ret =of_reserved_mem_region_to_resource (np, i +1 , &res);if (ret)return ret; - kproc->rmem[i].bus_addr = res.start; + ret =of_property_read_string_index (np,"memory-region-names" , + i +1 , ®ion_name); +/* +* lpm-metadata is a firewalled region accessible only by TIFS. +* Skip mapping it to avoid speculative access crashes. +*/ +if (!ret && !strcmp (region_name,"lpm-metadata" )) { +dev_dbg (dev,"Skipping firewalled memory region %s @0x%x\n" , + region_name, (u32 )res.start); +continue ; + } + + kproc->rmem[j].bus_addr = res.start;/* 64-bit address regions currently not supported */ - kproc->rmem[i].dev_addr = (u32 )res.start; - kproc->rmem[i].size =resource_size (&res); - kproc->rmem[i].cpu_addr =devm_ioremap_resource_wc (dev, &res); -if (IS_ERR (kproc->rmem[i].cpu_addr)) { + kproc->rmem[j].dev_addr = (u32 )res.start; + kproc->rmem[j].size =resource_size (&res); + kproc->rmem[j].cpu_addr =devm_ioremap_resource_wc (dev, &res); +if (IS_ERR (kproc->rmem[j].cpu_addr)) {dev_err (dev,"failed to map reserved memory#%d at %pR\n" , i +1 , &res);return -ENOMEM ; }dev_dbg (dev,"reserved memory%d: bus addr %pa size 0x%zx va %p da 0x%x\n" , - i +1 , &kproc->rmem[i].bus_addr, - kproc->rmem[i].size, kproc->rmem[i].cpu_addr, - kproc->rmem[i].dev_addr); + j +1 , &kproc->rmem[j].bus_addr, + kproc->rmem[j].size, kproc->rmem[j].cpu_addr, + kproc->rmem[j].dev_addr); + j++; } - kproc->num_rmems = num_rmems; + kproc->num_rmems = j;return 0 ; }
PATCH v4 3/7 arm64: dts: ti: k3-j7200-ti-ipc-firmware: Reserve memory for LPM metadata
In reply to Richard Genoud (TI)Declare a carveout memory region to store LPM metadata on J7200.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
As this is used by U-Boot SPL, bootph-pre-ram is added.
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi +10 -2
@@ -47,6 +47,12 @@ rtos_ipc_memory_region: memory@a4000000 { alignment = <0x1000>; no-map; }; + + lpm_memory_region: memory@a4800000 { + reg = <0x00 0xa4800000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + }; }; &mailbox0_cluster0 {
@@ -99,8 +105,10 @@ &mcu_r5fss0 { &mcu_r5fss0_core0 { mboxes = <&mailbox0_cluster0 &mbox_mcu_r5fss0_core0>; memory-region = <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; - memory-region-names = "dma", "firmware"; + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; status = "okay"; };
[email protected]
AI reviewRe: [PATCH v4 3/7] arm64: dts: ti: k3-j7200-ti-ipc-firmware: Reserve memory for LPM metadata
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] dt-bindings: ABI break: appending firewalled lpm_memory_region to memory-region array crashes…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: ABI break: appending firewalled lpm_memory_region to memory-region array crashes older kernels --
commit 07681f0176ba38c8ed49ce9e6c61d2f4b216437d
Author: Richard Genoud (TI) <[email protected]>
arm64: dts: ti: k3-j7200-ti-ipc-firmware: Reserve memory for LPM metadata
This commit declares a carveout memory region on J7200 to store LPM metadata, which is needed for saving ATF context and certificate information. It also appends this region to the mcu_r5fss0_core0 memory-region list.
Quoted 4 lines
arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi +0
-0
[ ... ]
arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi &mcu_r5fss0 { · line 110
Quoted 9 lines
arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi +3
-2@@ -99,8 +105,10 @@ &mcu_r5fss0 { &mcu_r5fss0_core0 { mboxes = <&mailbox0_cluster0 &mbox_mcu_r5fss0_core0>; memory-region = <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; - memory-region-names = "dma", "firmware"; + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata";
[Severity: High]
Does appending the firewalled lpm_memory_region to the standard memory-region array break Device Tree forward compatibility with older kernels?
Older kernel remoteproc drivers unconditionally iterate over all memory-region elements (skipping index 0) and map them using devm_ioremap_resource_wc():
drivers/remoteproc/ti_k3_common.c:k3_reserved_mem_init() {
...
kproc->rmem[j].cpu_addr = devm_ioremap_resource_wc(dev, &res);
...
}Since the region is firewalled by TIFS and mapped as Write-Combine (Normal Non-Cacheable memory), could speculative fetches to this memory trigger bus errors (SError) and crash the system?
To maintain compatibility when running a new Device Tree on an older kernel, should the firewalled region be provided via a custom property (e.g., ti,lpm-metadata) rather than overloading the standard memory-region array?
Quoted 3 lines
arch/arm64/boot/dts/ti/k3-j7200-ti-ipc-firmware.dtsi +1
-0+ bootph-pre-ram; status = "okay"; };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH v4 4/7 arm64: dts: ti: k3-j721s2-ti-ipc-firmware: Reserve memory for LPM metadata
In reply to Richard Genoud (TI)Declare a carveout memory region to store LPM metadata on J721S2.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added.
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- .../arm64/boot/dts/ti/k3-j721s2-ti-ipc-firmware.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721s2-ti-ipc-firmware.dtsi +10 -2
@@ -95,6 +95,12 @@ rtos_ipc_memory_region: memory@a8000000 { alignment = <0x1000>; no-map; }; + + lpm_memory_region: memory@a9c00000 { + reg = <0x00 0xa9c00000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + }; }; &mailbox0_cluster0 {
@@ -189,8 +195,10 @@ &mcu_r5fss0 { &mcu_r5fss0_core0 { mboxes = <&mailbox0_cluster0 &mbox_mcu_r5fss0_core0>; memory-region = <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; - memory-region-names = "dma", "firmware"; + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; status = "okay"; };
PATCH v4 5/7 arm64: dts: ti: k3-j784s4-ti-ipc-firmware: Reserve memory for LPM metadata
In reply to Richard Genoud (TI)Declare a carveout memory region to store LPM metadata on J784S4.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added and the device is enabled.
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- .../boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +15 -0
@@ -17,6 +17,12 @@ c71_3_memory_region: memory@ab100000 { reg = <0x00 0xab100000 0x00 0xf00000>; no-map; }; + + lpm_memory_region: memory@ac000000 { + reg = <0x00 0xac000000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + }; }; &mailbox0_cluster5 {
@@ -27,6 +33,15 @@ mbox_c71_3: mbox-c71-3 { }; }; +&mcu_r5fss0_core0 { + memory-region = <&mcu_r5fss0_core0_dma_memory_region>, + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; + status = "okay"; +}; + &c71_3 { mboxes = <&mailbox0_cluster5 &mbox_c71_3>; memory-region = <&c71_3_dma_memory_region>,
Re: [PATCH v4 5/7] arm64: dts: ti: k3-j784s4-ti-ipc-firmware: Reserve memory for LPM metadata
Quoted 41 lines · Richard Genoud (TI)
Declare a carveout memory region to store LPM metadata on J784S4.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DMhttps://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added and the device is enabled.
NB: This memory region is not part of DM memory (which is not retained at suspend)
Signed-off-by Prasanth Babu Mantena <[email protected]>Signed-off-by Richard Genoud (TI) <[email protected]>--- .../boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +0
-0
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi c71_3_memory_region: memory@ab100000 { · line 25
Quoted 9 lines
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +6
-0@@ -17,6 +17,12 @@ c71_3_memory_region: memory@ab100000 { reg = <0x00 0xab100000 0x00 0xf00000>; no-map; }; + + lpm_memory_region: memory@ac000000 { + reg = <0x00 0xac000000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + };
Could you move this carveout near to optee0x9E500000 to 0x9E800000 as LPM memory,
Since 0xa***_**** is used by firmware and this is just place-holder for lpm meta data.
Also better to move this k3-j784s4-j742s2-ti-ipc-firmware-common.dtsi file as these two SOCs are same and uses same map
Thanks
Udit
Quoted 19 lines
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +9
-0}; &mailbox0_cluster5 {@@ -27,6 +33,15 @@ mbox_c71_3: mbox-c71-3 { }; }; +&mcu_r5fss0_core0 { + memory-region = <&mcu_r5fss0_core0_dma_memory_region>, + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; + status = "okay"; +}; + &c71_3 { mboxes = <&mailbox0_cluster5 &mbox_c71_3>; memory-region = <&c71_3_dma_memory_region>,
Re: [PATCH v4 5/7] arm64: dts: ti: k3-j784s4-ti-ipc-firmware: Reserve memory for LPM metadata
Le 17/10/2026 à 09:05, Kumar, Udit a écrit :
Quoted 57 lines · Richard Genoud (TI)
Quoted 41 lines
Declare a carveout memory region to store LPM metadata on J784S4.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DMhttps://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added and the device is enabled.
NB: This memory region is not part of DM memory (which is not retained at suspend)
Signed-off-by Prasanth Babu Mantena <[email protected]>Signed-off-by Richard Genoud (TI) <[email protected]>--- .../boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +0
-0arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi c71_3_memory_region: memory@ab100000 { · line 25
Quoted 9 lines
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +6
-0@@ -17,6 +17,12 @@ c71_3_memory_region: memory@ab100000 { reg = <0x00 0xab100000 0x00 0xf00000>; no-map; }; + + lpm_memory_region: memory@ac000000 { + reg = <0x00 0xac000000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + };Could you move this carveout near to optee
0x9E500000to0x9E800000as LPM memory,
Quoted 5 lines
Since 0xa***_**** is used by firmware and this is just place-holder for lpm meta data.
Also better to move this
k3-j784s4-j742s2-ti-ipc-firmware-common.dtsifile as these two SOCs are same and uses same map
Ok I'll change to 0x9E500000 and merge with patch 7/7 (j742s2)
Thanks!
Regards,
Richard
Quoted 25 lines
Thanks
UditQuoted 19 lines
arch/arm64/boot/dts/ti/k3-j784s4-ti-ipc-firmware.dtsi +9
-0}; &mailbox0_cluster5 {@@ -27,6 +33,15 @@ mbox_c71_3: mbox-c71-3 { }; }; +&mcu_r5fss0_core0 { + memory-region = <&mcu_r5fss0_core0_dma_memory_region>, + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; + status = "okay"; +}; + &c71_3 { mboxes = <&mailbox0_cluster5 &mbox_c71_3>; memory-region = <&c71_3_dma_memory_region>,
Signature · 3 lines
Richard Genoud, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v4 6/7 arm64: dts: ti: k3-j722s-ti-ipc-firmware: Reserve memory for LPM metadata
In reply to Richard Genoud (TI)Declare a carveout memory region to store LPM metadata on J722S.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added.
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- arch/arm64/boot/dts/ti/k3-j722s-ti-ipc-firmware.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j722s-ti-ipc-firmware.dtsi +10 -2
@@ -59,6 +59,12 @@ rtos_ipc_memory_region: memory@a5000000 { alignment = <0x1000>; no-map; }; + + lpm_memory_region: memory@a6c00000 { + reg = <0x00 0xa6c00000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + }; }; &mailbox0_cluster0 {
@@ -122,8 +128,10 @@ &wkup_r5fss0 { &wkup_r5fss0_core0 { mboxes = <&mailbox0_cluster0 &mbox_wkup_r5_0>; memory-region = <&wkup_r5fss0_core0_dma_memory_region>, - <&wkup_r5fss0_core0_memory_region>; - memory-region-names = "dma", "firmware"; + <&wkup_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; status = "okay"; };
PATCH v4 7/7 arm64: dts: ti: k3-j742s2-ti-ipc-firmware: Reserve memory for LPM metadata
In reply to Richard Genoud (TI)Declare a carveout memory region to store LPM metadata on J742S2.
For Jacinto devices, this memory region is needed for saving ATF context and the certificate information of ATF and OPTEE and DM image. This LPM metadata area is firewalled to be accessed only by TIFS.
U-Boot R5 SPL/TIFS will use this area to save and restore:
- ATF context
- ATF certificate information
- OPTEE certificate information
- DM image (which has been copied in memory at boot time by U-Boot R5-SPL)
At resume, U-Boot R5 SPL is executed and detects that the board is resuming (with a flag set in the PMIC), then it:
- brings out of retention the DDR
- retrieves the LPM memory region from DTS
- authenticates certificates from LPM memory region and applies firewalls
- asks TIFS to restore TFA and its own minimal context
- starts TFA on remote proc
- loads back DM image from memory and jumps to DM
https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html#lpm-msg-lpm-save-addr
As this is used by U-Boot SPL, bootph-pre-ram is added and the device is enabled.
NB: This memory region is not part of DM memory (which is not retained at suspend)
--- arch/arm64/boot/dts/ti/k3-j742s2-evm.dts | 2 ++ .../dts/ti/k3-j742s2-ti-ipc-firmware.dtsi | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi
arch/arm64/boot/dts/ti/k3-j742s2-evm.dts +2 -0
@@ -24,3 +24,5 @@ memory@80000000 { bootph-all; }; }; + +#include "k3-j742s2-ti-ipc-firmware.dtsi"
arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/** + * Device Tree Source for enabling IPC using TI SDK firmware on J42S2 SoCs + * + * Copyright (C) 2026 Texas Instruments Incorporated - https://www.ti.com/ + * Copyright (C) 2026 Bootlin + */ + +&reserved_memory { + lpm_memory_region: memory@ab000000 { + reg = <0x00 0xab000000 0x00 0x00300000>; + no-map; + bootph-pre-ram; + }; +}; + +&mcu_r5fss0_core0 { + memory-region = <&mcu_r5fss0_core0_dma_memory_region>, + <&mcu_r5fss0_core0_memory_region>, + <&lpm_memory_region>; + memory-region-names = "dma", "firmware", "lpm-metadata"; + bootph-pre-ram; + status = "okay"; +};
[email protected]
AI reviewRe: [PATCH v4 7/7] arm64: dts: ti: k3-j742s2-ti-ipc-firmware: Reserve memory for LPM metadata
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dts: typo in SoC name in header comment --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dts: typo in SoC name in header comment
--
commit 4a69ff2c69c45956aad19749ee19fa4b33a413cf
Author: Richard Genoud (TI) <[email protected]>
arm64: dts: ti: k3-j742s2-ti-ipc-firmware: Reserve memory for LPM metadata
This commit declares a carveout memory region to store LPM metadata on the J742S2 platform. The reserved memory is used to save and restore ATF, OPTEE, and DM image context during suspend and resume cycles.
arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi line 3
Quoted 9 lines
arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi new file +3
-0@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/** + * Device Tree Source for enabling IPC using TI SDK firmware on J42S2 SoCs
[Severity: Low]
There appears to be a typo in the SoC name in the header comment of arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi. Should J42S2 be corrected to J742S2?
Quoted 4 lines
arch/arm64/boot/dts/ti/k3-j742s2-ti-ipc-firmware.dtsi new file +4
-0+ * + * Copyright (C) 2026 Texas Instruments Incorporated - https://www.ti.com/ + * Copyright (C) 2026 Bootlin + */
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7