From: sashiko-bot@kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 4/5] arm64: dts: ti: k3-am62p-ti-ipc-firmware: Split r5f memory region
Date: Mon, 01 Jun 2026 09:26:41 +0000 [thread overview]
Message-ID: <20260601092642.1B71E1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260601-topic-am62a-ioddr-dt-v6-19-v5-4-3856a023aff2@baylibre.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Fragmentation of the reserved memory region breaks backward compatibility for firmware loading.
- [High] Board-specific firmware memory sizes are overwritten and duplicated, causing overlapping reservations and memory starvation.
- [Medium] Encoding firmware-specific software layout policy into the hardware description device tree.
--
commit c6bb6a1bb6896ca4a20a285fa611156e2c906d69
Author: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
arm64: dts: ti: k3-am62p-ti-ipc-firmware: Split r5f memory region
This patch splits the firmware memory region in the AM62p IPC device tree
into multiple smaller parts. The stated goal is to describe where to find
specific information, such as LPM metadata, for bootloaders like U-Boot.
> diff --git a/arch/arm64/boot/dts/ti/k3-am62p-ti-ipc-firmware.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-ti-ipc-firmware.dtsi
> index 12902231e58a7..437b1df02142c 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62p-ti-ipc-firmware.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62p-ti-ipc-firmware.dtsi
> @@ -24,9 +24,33 @@ wkup_r5fss0_core0_dma_memory_region: memory@9c800000 {
> no-map;
> };
>
> - wkup_r5fss0_core0_memory_region: memory@9c900000 {
> + wkup_r5fss0_core0_ipc_region: memory@9c900000 {
> compatible = "shared-dma-pool";
> - reg = <0x00 0x9c900000 0x00 0xf00000>;
> + reg = <0x00 0x9c900000 0x00 0x100000>;
> + no-map;
> + };
[Severity: High]
Does splitting this contiguous 15MB firmware region into smaller adjacent
sub-regions break backward compatibility for firmware loading?
Looking at k3_rproc_da_to_va() in drivers/remoteproc/ti_k3_common.c, there is
an exact check that enforces a loaded ELF segment must fit within a single
DT memory region:
if (da >= dev_addr && ((da + len) <= (dev_addr + size))) {
offset = da - dev_addr;
va = kproc->rmem[i].cpu_addr + offset;
If an existing firmware ELF segment (like .data or .bss) spans across these
new boundaries, it looks like it will fail this bounds check, returning NULL
and preventing the remote processor from booting.
[Severity: High]
Could this redefinition truncate or duplicate board-specific firmware memory
sizes?
This common dtsi file is typically included at the end of board-specific
device trees. For example, in arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi,
the board defines a 30MB region at memory@9c900000. This patch redefines
memory@9c900000 with a size of 1MB, which seems to silently truncate the
board's memory allocation.
Additionally, in arch/arm64/boot/dts/ti/k3-am62p5-var-som.dtsi, the board
labels the node r5f-memory@9c900000:
wkup_r5fss0_core0_memory_region: r5f-memory@9c900000 {
compatible = "shared-dma-pool";
reg = <0x00 0x9c900000 0x00 0x01e00000>;
no-map;
};
Because the node names differ (memory vs r5f-memory), both would be
instantiated at the same unit address, causing overlapping memory
reservations.
> +
> + wkup_r5fss0_core0_lpm_fs_stub_region: memory@9ca00000 {
[ ... ]
> @@ -56,8 +80,14 @@ &wkup_r5fss0 {
> &wkup_r5fss0_core0 {
> mboxes = <&mailbox0_cluster0 &mbox_r5_0>;
> memory-region = <&wkup_r5fss0_core0_dma_memory_region>,
> - <&wkup_r5fss0_core0_memory_region>;
> - memory-region-names = "dma", "firmware";
> + <&wkup_r5fss0_core0_ipc_region>,
> + <&wkup_r5fss0_core0_lpm_fs_stub_region>,
> + <&wkup_r5fss0_core0_lpm_metadata_region>,
> + <&wkup_r5fss0_core0_lpm_rest_region>,
> + <&wkup_r5fss0_core0_dm_region>;
> + memory-region-names = "dma", "ipc", "lpm-stub",
> + "lpm-metadata", "lpm-context",
> + "dm-firmware";
[Severity: High]
Will hardcoding the memory-region array here override board-level DT
configurations?
By explicitly redefining the memory-region array, it discards board-level
allocations. This appears to restrict the remoteproc driver to only 15MB of
mapped memory, which might starve the firmware on boards that require a
larger allocation.
[Severity: Medium]
Does hardcoding these specific memory sections encode firmware-specific
software layout policy into the hardware description?
The device tree is intended to describe hardware architecture and memory
reservations, not software layout. By defining granular sections like
lpm-stub and lpm-metadata here, the DT becomes tightly coupled to a
specific version of the firmware linker script.
If future firmware changes the internal memory layout, this would require a
device tree update. Should the bootloader locate metadata using an
in-memory structure or a fixed offset instead of fracturing the device
tree?
> status = "okay";
> };
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260601-topic-am62a-ioddr-dt-v6-19-v5-0-3856a023aff2@baylibre.com?part=4
next prev parent reply other threads:[~2026-06-01 9:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 8:46 [PATCH v5 0/5] arm64: dts: ti: k3-am62a7-sk: Split r5f memory region Markus Schneider-Pargmann (TI)
2026-06-01 8:46 ` [PATCH v5 1/5] arm64: dts: ti: k3-am62a-ti-ipc-firmware: Move wkup reserved memory Markus Schneider-Pargmann (TI)
2026-06-01 8:46 ` [PATCH v5 2/5] arm64: dts: ti: k3-am62p-ti-ipc-firmware: " Markus Schneider-Pargmann (TI)
2026-06-01 9:02 ` sashiko-bot
2026-06-01 12:42 ` Francesco Dolcini
2026-06-01 8:46 ` [PATCH v5 3/5] arm64: dts: ti: k3-am62a-ti-ipc-firmware: Split r5f memory region Markus Schneider-Pargmann (TI)
2026-06-01 9:13 ` sashiko-bot
2026-06-01 8:46 ` [PATCH v5 4/5] arm64: dts: ti: k3-am62p-ti-ipc-firmware: " Markus Schneider-Pargmann (TI)
2026-06-01 9:26 ` sashiko-bot [this message]
2026-06-01 8:46 ` [PATCH v5 5/5] arm64: dts: ti: k3-am62p-ti-ipc-firmware: Add r5f nodes to pre-ram bootphase Markus Schneider-Pargmann (TI)
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=20260601092642.1B71E1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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