mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: dts: i.MX8MP: remove memory node
Date: Tue, 14 Mar 2023 15:08:29 +0100	[thread overview]
Message-ID: <20230314140829.GJ7446@pengutronix.de> (raw)
In-Reply-To: <20230312162928.2110697-1-m.felsch@pengutronix.de>

On Sun, Mar 12, 2023 at 05:29:28PM +0100, Marco Felsch wrote:
> since commit f083fffe52 ("ARM: dts: i.MX8MP: add DDRC compatibles") we
> make use of the esdctl driver. This cause the below error since barebox
> try to add the memory twice.
> 
> | imx-esdctl 3d400000.memory-controller@3d400000.of: probe failed: Device or resource busy
> | initcall imx_esdctl_driver_init+0x0/0x2c failed: No such device
> 
> Remove the memory node to fix this.
> 
> This behaviour was seen on a i.mx8mp-evk but the
> imx8mp-tqma8mpql-mba8mpxl also has a memory node and includes the
> barebox.dtsi.
> 
> Fixes: f083fffe52 ("ARM: dts: i.MX8MP: add DDRC compatibles")
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
>  arch/arm/dts/imx8mp-evk.dts                | 2 ++
>  arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts | 2 ++
>  2 files changed, 4 insertions(+)

Applied for now as it fixes a regression.

For the longer run I'd like to try another approach:

On i.MX as well as on other SoCs we read the DDR resources from the
memory controller. When we do this it should take precedence over the
device tree memory nodes. If reading from the memory controller returns
wrong DDR resources then this is a bug that should be fixed. Trying to
merge the memory banks read from the controller with the ones from the
device tree likely doesn't improve the situation.

Therefore the memory controller should register the memory banks along
with some we-know-it-better flag which disables reading the memory
nodes from the device tree. This leaves reading the memory nodes from
the device tree for the cases where no memory controller driver is
available.

There are some known cases where the memory controller is configured
with bigger SDRAM than is actually equipped on the board. We'll find
the memory mirrored than in the registered memory banks. For i.MX
we have imx_esdctl_disable() for this case, the same could be done
for other SoCs as well if needed.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2023-03-14 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 16:29 Marco Felsch
2023-03-13 13:03 ` Lucas Stach
2023-03-13 13:46   ` Marco Felsch
2023-03-13 13:16 ` Ahmad Fatoum
2023-03-13 13:49   ` Marco Felsch
2023-03-13 13:58     ` Ahmad Fatoum
2023-03-13 14:02       ` Ahmad Fatoum
2023-03-13 16:08         ` Marco Felsch
2023-03-14 14:08 ` Sascha Hauer [this message]

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=20230314140829.GJ7446@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.felsch@pengutronix.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