Bug: qemu_arm64: Cannot access the second flash bank

Robin Randhawa Robin.Randhawa at ARM.com
Thu Jan 9 16:21:47 CET 2020


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 ?

Thanks,
Robin





More information about the U-Boot mailing list