All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de, git@xilinx.com
Cc: Alexandre GRIVEAUX <agriveaux@deutnet.info>,
	Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>,
	Aswath Govindraju <a-govindraju@ti.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Lukasz Majewski <lukma@denx.de>, Michal Simek <monstr@monstr.eu>,
	Simon Glass <sjg@chromium.org>,
	T Karthik Reddy <t.karthik.reddy@xilinx.com>
Subject: [PATCH] xilinx: Disable ARCH_FIXUP_FDT_MEMORY
Date: Fri,  6 Aug 2021 14:22:56 +0200	[thread overview]
Message-ID: <1f2589b334942bc5adeedd5df58e6af32ec31ce2.1628252571.git.michal.simek@xilinx.com> (raw)

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 | 1 +
 configs/xilinx_zynq_virt_defconfig   | 1 +
 configs/xilinx_zynqmp_virt_defconfig | 1 +
 3 files changed, 3 insertions(+)

diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
index e67905178dee..c894d32a9259 100644
--- a/configs/xilinx_versal_virt_defconfig
+++ b/configs/xilinx_versal_virt_defconfig
@@ -13,6 +13,7 @@ CONFIG_COUNTER_FREQUENCY=100000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_PREBOOT=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
index b4c7f11505c1..573a10fe221b 100644
--- a/configs/xilinx_zynq_virt_defconfig
+++ b/configs/xilinx_zynq_virt_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_LEGACY_IMAGE_FORMAT=y
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_FPGA=y
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index 623228053e47..2c888130fa59 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -21,6 +21,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="scsi reset;usb reset"
 # CONFIG_DISPLAY_CPUINFO is not set
-- 
2.32.0


             reply	other threads:[~2021-08-06 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 12:22 Michal Simek [this message]
2021-08-06 18:46 ` [PATCH] xilinx: Disable ARCH_FIXUP_FDT_MEMORY Tom Rini
2021-08-09  6:24   ` Michal Simek
2021-08-09 16:31     ` Tom Rini
2021-08-10 11:44       ` Michal Simek
2021-08-23  6:49 ` Michal Simek

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=1f2589b334942bc5adeedd5df58e6af32ec31ce2.1628252571.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=a-govindraju@ti.com \
    --cc=agriveaux@deutnet.info \
    --cc=ashok.reddy.soma@xilinx.com \
    --cc=git@xilinx.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=lukma@denx.de \
    --cc=monstr@monstr.eu \
    --cc=sjg@chromium.org \
    --cc=t.karthik.reddy@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.