public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Michal Simek <michal.simek@xilinx.com>
Cc: u-boot@lists.denx.de, git@xilinx.com,
	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: Re: [PATCH] xilinx: Disable ARCH_FIXUP_FDT_MEMORY
Date: Fri, 6 Aug 2021 14:46:56 -0400	[thread overview]
Message-ID: <20210806184656.GD858@bill-the-cat> (raw)
In-Reply-To: <1f2589b334942bc5adeedd5df58e6af32ec31ce2.1628252571.git.michal.simek@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

On Fri, Aug 06, 2021 at 02:22:56PM +0200, Michal Simek wrote:

> 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.

I don't object to the patch at all.  The main use of
fdt_fixup_memory_banks() is for the (at least used to be most common)
case of device trees that didn't fill in memory size, so that it could
be done at run-time, depending on the amount found.  I do wonder if
CONFIG_ARCH_FIXUP_FDT_MEMORY being default makes the most sense these
days.  Or maybe we just need some comments on fdt_fixup_memory_banks
making it clear which way we implement the spec as it does allow for as
you note, either way.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-08-06 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 12:22 [PATCH] xilinx: Disable ARCH_FIXUP_FDT_MEMORY Michal Simek
2021-08-06 18:46 ` Tom Rini [this message]
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=20210806184656.GD858@bill-the-cat \
    --to=trini@konsulko.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=michal.simek@xilinx.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox