xilinx: Disable ARCH_FIXUP_FDT_MEMORY
authorMichal Simek <michal.simek@xilinx.com>
Fri, 6 Aug 2021 12:09:32 +0000 (14:09 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 26 Aug 2021 06:08:11 +0000 (08:08 +0200)
commit1031a11d71d48df0f738d4e4e744d025ce7e7aad
tree00b536c764aba81f05b8254d6c898d283d306000
parentc2b7244322444ab3f3eb56890192cb02ba200534
xilinx: Disable ARCH_FIXUP_FDT_MEMORY

Based on DT spec you can have one memory node which multiple ranges or
multiple nodes.
fdt_fixup_memory_banks() is not implemented in a correct way when multiple
memory nodes are present because all ranges are put it to the first memory
node found. And next memory nodes are kept in DT which ends up in the same
range specification in the same DT.

Here is what it is happening.
Origin DT.
memory@0 {
        device_type = "memory";
        reg = <0x0 0x0 0x0 0x80000000>;
};

memory@800000000 {
        device_type = "memory";
        reg = <0x8 0x00000000 0x0 0x80000000>;
};

After fdt_fixup_memory_banks()

memory@0 {
        device_type = "memory";
        reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
};

memory@800000000 {
        device_type = "memory";
        reg = <0x8 0x00000000 0x0 0x80000000>;
};

As is visible memory@0 node got second range but there is still
memory@800000000 node present and 2G range is listed twice.

The solution can't be that second node is removed because it can be
referenced already that's why it is better for us to disable this option
for now.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
configs/xilinx_versal_virt_defconfig
configs/xilinx_zynq_virt_defconfig
configs/xilinx_zynqmp_virt_defconfig