All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: "Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Jarrah Gosbell" <kernel@undef.tools>,
	"Arnaud Ferraris" <arnaud.ferraris@collabora.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	u-boot@lists.denx.de,
	"Detlev Casanova" <detlev.casanova@collabora.com>,
	"Frédéric Danis" <frederic.danis@collabora.com>,
	"Tom Rini" <trini@konsulko.com>
Subject: Re: [PATCH] pstore: Use root address-cells/size-cells as defaults for reserved-memory
Date: Mon, 16 Oct 2023 15:23:58 +0300	[thread overview]
Message-ID: <ZS0rXlNfPjP5dLEa@skv.local> (raw)
In-Reply-To: <20230826194127.30117656@slackpad.lan>

Hi,

On 23-08-26 19:41, Andre Przywara wrote:
> On Sat, 26 Aug 2023 15:10:10 +0200
> Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 
> Hi,
> 
> > On 8/26/23 14:16, Andrey Skvortsov wrote:
> > > u-boot adds reserve-memory node, if it's missing, with following
> > > properties:
> > >
> > > ```
> > >      reserved-memory {
> > >           #address-cells = <2>;
> > >           #size-cells = <2>;  
> > 
> > This defines the size of cells for the children of reserved-memory and
> > and for the ranges property. If you set the cell sizes to 1 you can no
> > longer encode 64 bit addresses.
> 
> Yes, this is expected in this case, the Allwinner A64 SoC has its memory
> map (including DRAM) completely below 4GB, hence the root node can go
> with 1/1.
> 
> > 
> > >           ranges;
> > >      }
> > > ```
> > >
> > > But with these default address-cells and size-cells values, pstore
> > > isn't working on A64. Root node for A64 defines 'address-cells' and
> > > 'size-cells' as 1.
> > >
> > > dtc complains if reserved-memory has different address-cells and
> > > size-cells.
> > >
> > > ```
> > >       Warning (ranges_format): /reserved-memory:ranges: empty "ranges"
> > >       property but its #address-cells (2) differs from / (1)  
> > 
> > I cannot find any such requirement in the Devicetree Specification 1.4.
> > Is this a dtc bug?
> 
> I think the culprit here is the *empty* ranges property:
> "If the property is defined with an <empty> value, it specifies that the
> parent and child address space is identical, and no address translation
> is required."
> As this is contradicted by the differing #a-c/#s-z properties, it looks
> like dtc has good reasons to warn.
> 
> > 
> > > ```
> > >
> > > This patch takes into account address-cells and size-cells of the root
> > > node and uses them as values for new reserved-memory node.  
> > 
> > Reservations may be above 4 GiB. How does your patch consider this?
> 
> If the root #a-c/#s-c don't allow for more than 4GB, then it's for a
> reason (in this case, the A64 being 32-bit only, even with AArch64
> capable cores), and keeping it isn't restricting it further. So I think
> copying the root properties is the right thing to do. I think almost
> every other 64-bit core uses 2/2 anyway, so it's just the odd outlier
> here.
> 
> Cheers,
> Andre

Are there any comments I should fix to get this change merged or maybe
another way of solving this problem?

I see, that patch requires review from Tom Rini currently on patchwork [1].

1. https://patchwork.ozlabs.org/project/uboot/patch/20230826121652.2487643-1-andrej.skvortzov@gmail.com/

-- 
Best regards,
Andrey Skvortsov

  reply	other threads:[~2023-10-16 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26 12:16 [PATCH] pstore: Use root address-cells/size-cells as defaults for reserved-memory Andrey Skvortsov
2023-08-26 13:10 ` Heinrich Schuchardt
2023-08-26 18:41   ` Andre Przywara
2023-10-16 12:23     ` Andrey Skvortsov [this message]
2023-08-26 20:06   ` Andrey Skvortsov
2023-10-24 23:16 ` Tom Rini

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=ZS0rXlNfPjP5dLEa@skv.local \
    --to=andrej.skvortzov@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=arnaud.ferraris@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=frederic.danis@collabora.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kernel@undef.tools \
    --cc=pavel@ucw.cz \
    --cc=samuel@sholland.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.