u-boot-brain/arch
Mario Six e8d5291824 core: ofnode: Fix translation for #size-cells == 0
Commit 286ede6 ("drivers: core: Add translation in live tree case") made
dev_get_addr always use proper bus translations for addresses read from
the device tree. But this leads to problems with certain busses, e.g.
I2C busses, which run into an error during translation, and hence stop
working.

It turns out that of_translate_address() and fdt_translate_address()
stop the address translation with an error when they're asked to
translate addresses for busses where #size-cells == 0 (comment from
drivers/core/of_addr.c):

 * Note: We consider that crossing any level with #size-cells == 0 to mean
 * that translation is impossible (that is we are not dealing with a value
 * that can be mapped to a cpu physical address). This is not really specified
 * that way, but this is traditionally the way IBM at least do things

To fix this case, we check in both the live-tree and non-live tree-case,
whether the bus of the device whose address is about to be translated
has size-cell size zero. If this is the case, we just read the address
as a plain integer and return it, and only apply bus translations if the
size-cell size if greater than zero.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Reported-by: Martin Fuzzey <mfuzzey@parkeon.com>
Fixes: 286ede6 ("drivers: core: Add translation in live tree case")
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-04-01 22:19:10 +08:00
..
arc ARC: bootm: Refactor GO and PREP subcommands implementation 2018-03-23 15:57:51 +03:00
arm arm64: zynqmp: Add support for verifying secure images 2018-03-23 09:36:15 +01:00
m68k Convert CONFIG_SYS_BOOT_GET_{CMDLINE, KBD} to Kconfig 2018-01-30 12:52:57 -05:00
microblaze fdt: Implement weak arch_fixup_fdt() 2018-02-18 12:53:38 -07:00
mips mips: bmips: add ar-5315 usb support 2018-03-21 23:23:13 +01:00
nds32 fdt: Implement weak arch_fixup_fdt() 2018-02-18 12:53:38 -07:00
nios2 nios2: 10m50: Add CPU pre-relocation in device tree 2017-11-17 10:51:24 -05:00
powerpc ppc: Remove orphan xilinx_irq.h file 2018-03-16 14:54:14 -04:00
riscv riscv: Add Kconfig to support RISC-V 2018-01-12 08:05:12 -05:00
sandbox core: ofnode: Fix translation for #size-cells == 0 2018-04-01 22:19:10 +08:00
sh sh: Do not provide strncmp 2018-02-23 00:06:05 +01:00
x86 common: move init_helpers.h prototypes in init.h 2018-03-16 14:56:59 -04:00
xtensa xtensa: clean up CONFIG_SYS_TEXT_ADDR 2018-02-23 10:21:41 -05:00
.gitignore
Kconfig Move most CONFIG_HAVE_BLOCK_DEVICE to Kconfig 2018-02-08 19:09:03 -05:00