mbox series

[0/2] Reading size-cells and address-cells from a node should walk up the

Message ID 20200408093528.24276-1-matthias.bgg@kernel.org
Headers show
Series Reading size-cells and address-cells from a node should walk up the | expand

Message

Matthias Brugger April 8, 2020, 9:35 a.m. UTC
From: Matthias Brugger <mbrugger at suse.com>

parent stack to find the property. This is reflected through comments in
the code, but actually not implemented. This leads to the fact that some
DTBs worked by accident. Fix this by walking the tree when reading this
properties.

After fixing the default size-cells returned when the property is not
present this problem was made visible. When adding flash devices in qemu
for arm64, the size-cells was wrongly inpterpreted and broke access to the
second flash bank.


Matthias Brugger (2):
  libfdt: Make fdt_cells function accessible
  dm: core: Walk the tree to find address- and size-cells properties

 drivers/core/ofnode.c              |  8 +++----
 include/dm/ofnode.h                | 36 ++++++++++++++++++++++++++++++
 include/dm/read.h                  |  6 ++---
 scripts/dtc/libfdt/fdt_addresses.c |  2 +-
 scripts/dtc/libfdt/libfdt.h        |  2 ++
 5 files changed, 45 insertions(+), 9 deletions(-)

Comments

Robin Randhawa April 8, 2020, 2:48 p.m. UTC | #1
Hi Matthias.

Thanks for this. 

I can confirm that this fixes the reported problem. You have my Tested-By.
FWIW, the changes look fine to me too.

Cheers,
Robin