All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	kbuild test robot <lkp@intel.com>,
	"kbuild-all@01.org" <kbuild-all@01.org>,
	Grant Likely <grant.likely@linaro.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH v2] of/fdt: Allow memory node and root to have different size/address cells
Date: Thu, 01 Oct 2015 14:21:59 +0200	[thread overview]
Message-ID: <1712345.yOlLsP4Oji@wuerfel> (raw)
In-Reply-To: <1443701901-362-1-git-send-email-vgupta@synopsys.com>

On Thursday 01 October 2015 17:48:21 Vineet Gupta wrote:
> Currently memory node parsing uses root "#size-cells", "#address-cells"
> This doesn't work correctly when memory address/size is different or
> greater than root's.
> 
> e.g. ARC 32-bit systems implementing physical adressing extension and
> say 4GB of memory. All peripherals mappings stay within the 4GB (so root
> address/size cells remain 1 each), only the memory node address/size
> cells needs to specify greater than 32-bits as below
> 
>         memory {
>                 device_type = "memory";
>                 reg = <0x0 0x80000000 0x1 0x00000000>;  /* 4 GB */
>                 #address-cells = <2>;
>                 #size-cells = <2>;
>         };
> 
> This patch lets me boot a ARC system with PAE40 + 4GB of memory specified
> as above and fails to boot otherwise as memory parsing doesn't populate
> right base, size.
> 

This looks wrong: the #address-cells property in a device node is used
to parse the reg property of its child nodes, not the node itself.

The only way to list memory like this is to put #size-cells=<2>
into the root node. All lower bus nodes can then use the
normal #address-cells/#size-cells again and use a ranges property
to convert the register ranges so you don't need to update all
nodes.

	Arnd

  reply	other threads:[~2015-10-01 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 12:18 [PATCH v2] of/fdt: Allow memory node and root to have different size/address cells Vineet Gupta
2015-10-01 12:18 ` Vineet Gupta
2015-10-01 12:18 ` Vineet Gupta
2015-10-01 12:21 ` Arnd Bergmann [this message]
2015-10-03  8:08   ` Vineet Gupta

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=1712345.yOlLsP4Oji@wuerfel \
    --to=arnd@arndb.de \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=kbuild-all@01.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=robh+dt@kernel.org \
    /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.