Hi Tom,

On Tue Sep 22, 2026 at 11:24 PM CST, Tom Rini wrote:
> On Tue, Sep 22, 2026 at 10:38:45PM +0800, Junhui Liu wrote:
>> The device tree loaded for the OS may contain a static memory
>> description that does not match the layout determined by the firmware.
>> RISC-V currently relies on board-specific fixups to pass that layout to
>> the OS.
>> 
>> Update the OS memory nodes from gd->dram[] in arch_fixup_fdt(), as ARM
>> already does. Platforms that need to keep the memory description in the
>> OS device tree unchanged can disable CONFIG_ARCH_FIXUP_FDT_MEMORY.
>> 
>> Disable this option for the generic Microchip MPFS configuration. The
>> supported Icicle Kit device tree uses multiple memory nodes, whereas
>> fdt_fixup_memory_banks() writes all banks into the first node and leaves
>> the others untouched. This would duplicate memory ranges, so preserve
>> the existing memory description for this configuration.
>> 
>> Signed-off-by: Junhui Liu <[email protected]>
>
> What is Icicle doing such that arch_fixup_fdt shouldn't be written to
> handle that case correctly (and is it not handled correctly already on
> say ARM?) ? Thanks.

You're right. We should fix fdt_fixup_memory_banks() to handle this
case correctly.

I also checked the ARM platforms and found multiple memory nodes in
Renesas, ASPEED, MediaTek, i.MX and some other device trees. Renesas
removes duplicate memory nodes in its board fixup through
scrub_duplicate_memory(), while the other platforms do not appear to
remove the duplicate descriptions from the device tree.

I will work on a common solution and include it in the next version.

-- 
Best regards,
Junhui Liu

Reply via email to