From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933527AbbJAMWX (ORCPT ); Thu, 1 Oct 2015 08:22:23 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:64246 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933132AbbJAMWT (ORCPT ); Thu, 1 Oct 2015 08:22:19 -0400 From: Arnd Bergmann To: Vineet Gupta Cc: Rob Herring , kbuild test robot , "kbuild-all@01.org" , Grant Likely , 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 Message-ID: <1712345.yOlLsP4Oji@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1443701901-362-1-git-send-email-vgupta@synopsys.com> References: <1443701901-362-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:NdS3SQIA5/n0vMAT2w3KlvSR22PJN6wgbmFBU7Nt9jJogMTy0ZX omDG4QtsgjKH4GPAEy44EKPYP/s6DcTKulZ5zupHAAUVQe5nreqJYZ2p798JG22mEqwcj35 uyL+CHLlQY01LLta++N9yV1Fu+vxyD3waXa1hZflvv1pJajtMqKMHFrULrnR7/QPvTnHjeX 8uucvwKjx2u1UE+2MyAyw== X-UI-Out-Filterresults: notjunk:1;V01:K0:t8+HBthTi6s=:5KfGKfI6CaxE9s3YzC3zSd IKL5J1R+r7WqQIY9p0v00bx/ZKzeflTFqnNeHI+SsuFSJWf54ss/YbgCtOq/o0ya+pl9l9ieG x3lxrpmWMPHvWtz5SN8P9uVaX3n5gPXHtalL7P4qE07E08Apyyek7K9EuK7jsYnup9zYtfR8e ryQOndtFT/MSC/E74BmzbsPbwRAyxHjouWzh2E7NJ/pmNm+HiNkcmjhWXbjVW/7SOZIhbh+pt oFM72ilFjul1rjx/tyc1rvAUR8usMpvtjxWuBrH+5iubidBsMvC51BjjCmkfzykFg5dMQUtBg wieymn1KhBdnTatQPnolbQ3bPhYeOkisNygvz/sgToTbrgqJ5RvU/AoLgVW1kUzc1OxJRSagw ppSOjoETgAwm2/lMltUoxYKUWhNCIhJoiALrNT7IpJ18hKPRU93uxHJJNbLchWteRwEPchuWk 5CU1nmxXlaZ8VHAQ1dXGwSzc9PyKO/l9JED/UNar/KdlAatn8O29ACddMONROWpYgserMYM+B kzDwo69DLlC8tb6hH3/S8pD0q4VR9XPF8BvfCXFQYbheCsaR2R6ZFPqf013dxg3H65D25Xg9V hliN7oCVJ/LHtKz0WMyzXNVoP44A0Od/+WbT2gsiKX4o3UmxubVgI9AK9FBHCEb8BCDlJXFn+ Pw+nAFCevpuyzVvFXNBhfND94P0H8eOvKVS1XwmdYKwcfBuprubHeggQjfqwChDmGTLzV7SeC JtjPlW1ZVfrZ/g1Q Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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