From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Brugger Date: Wed, 8 Apr 2020 10:54:12 +0200 Subject: Bug: qemu_arm64: Cannot access the second flash bank In-Reply-To: References: <0b369251d75f395bd95e30d4e603414a8ab1ebb3.camel@arm.com> <8491aa4d-b58a-1205-c2d6-cabc9631b381@suse.com> <1da7cdd3f3e7dcde1d25c4ddaa86ba0ec606e688.camel@arm.com> Message-ID: <08367cd7-e24f-c142-a6e2-04bf99396718@suse.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Robin, On 09/01/2020 16:21, Robin Randhawa wrote: > On Thu, 2020-01-09 at 15:57 +0100, Matthias Brugger wrote: > > [...] > >> The property expects size-cells to be two, but U-Boot will use one >> cell if no >> size-cells are defined in the device node (which is not the case) and >> therefor >> will see >> >> Bank1: Flashbase 0x0 0x0 Flashsize 0x4000000 >> Bank2: Flashbase 0x4000000 0x0 Flashsize 0x4000000 > > My knowledge of DT is superficial. However, looking at the following > lines from the spec: > > - A |spec|-compliant boot program shall supply #address-cells and > #size-cells on all nodes that have children. > > - If missing, a client program should assume a default value of 2 for > #address-cells, and a value of 1 for #size-cells. > > .. and contrasting with the root node and device node in question from > the DTS for this platform: > > / { > interrupt-parent = <0x8001>; > #size-cells = <0x2>; > #address-cells = <0x2>; > compatible = "linux,dummy-virt"; > . > . > > flash at 0 { > bank-width = <0x4>; > reg = <0x0 0x0 0x0 0x4000000 0x0 0x4000000 0x0 0x4000000>; > compatible = "cfi-flash"; > }; > > .. it seems to me that while the flash node is missing #size-cells, > given that #size-cells _is_ defined in the parent node ("the node that > has children") then that value (0x2) is the one u-boot should have used > but didn't. > > Maybe the u-boot DT interpreting logic needs to check if the parent > node also does not specify #size-cells before making the assumption > that the value 1 is to be used ? > Sorry for taking so long. Yes you are correct, I found the issue in U-Boot and I'm working on a patch. Please stay tuned. Regards, Matthias