u-boot-brain/test/dm
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
..
adc.c sandbox: add ADC unit tests 2015-11-02 10:38:00 +09:00
blk.c blk: dm: make blk_create_device() take a number of block instead of a size 2017-09-11 21:43:58 -06:00
bus.c dm: core: parse chosen node 2018-01-15 11:35:38 -05:00
clk.c clk: convert API to match reset/mailbox style 2016-06-19 17:05:55 -06:00
cmd_dm.c CONFIG_NEEDS_MANUAL_RELOC: Fix warnings when not set 2015-12-07 08:35:23 -05:00
core.c dm: core: Add a function to look up a uclass by name 2018-02-03 10:08:40 -07:00
eth.c test/dm: Fix string handling issues in the eth test 2017-10-06 11:28:20 -04:00
gpio.c dm: test: Add GPIO open drain tests 2016-06-03 22:14:20 -07:00
i2c.c dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
Kconfig test: Move the unit tests to their own menu 2015-05-21 09:16:17 -04:00
led.c dm: led: Add support for blinking LEDs 2017-04-14 19:38:57 -06:00
mailbox.c mailbox: implement a sandbox test 2016-05-26 20:48:31 -06:00
Makefile dm: test: Add tests for the generic PHY uclass 2017-05-09 12:14:16 -06:00
mmc.c dm: mmc: test: Add tests for MMC 2016-05-17 09:54:43 -06:00
pci.c dm: test: Convert PCI tests to use the DM PCI API 2016-01-12 10:19:09 -07:00
phy.c dm: phy: Update tests to use ut_asserteq() 2017-06-01 07:03:14 -06:00
pmic.c test: Generalize the unit test framework 2015-05-21 09:16:16 -04:00
power-domain.c Add a power domain framework/uclass 2016-07-27 16:29:56 -06:00
pwm.c test: pwm: Add a check that dev is not NULL 2017-06-12 08:38:06 -04:00
ram.c dm: test: Add a test for the ram uclass 2015-07-21 17:39:32 -06:00
regmap.c test: Add a test for regmap 2015-07-21 17:39:33 -06:00
regulator.c power: extend prefix match to regulator-name property 2017-12-12 19:53:45 -07:00
remoteproc.c test: Add basic tests for remoteproc 2015-10-22 14:18:40 -04:00
reset.c reset: implement a reset test 2016-06-19 17:05:55 -06:00
rtc.c test: Generalize the unit test framework 2015-05-21 09:16:16 -04:00
sf.c test: Generalize the unit test framework 2015-05-21 09:16:16 -04:00
spi.c dm: core: Add flags parameter to device_remove() 2017-04-04 20:15:10 -06:00
spmi.c spmi: Add sandbox test driver 2016-04-01 17:18:12 -04:00
syscon.c dm: syscon: Allow finding devices by driver data 2016-01-24 12:07:19 +08:00
sysreset.c Rename reset to sysreset 2016-05-26 20:48:31 -06:00
test-driver.c dm: test: Add test for device removal 2017-04-04 20:15:10 -06:00
test-fdt.c core: ofnode: Fix translation for #size-cells == 0 2018-04-01 22:19:10 +08:00
test-main.c dm: test: replace dm_scan_dt() by of dm_extended_scan_fdt() in dm_do_test 2017-09-11 21:43:58 -06:00
test-uclass.c test: Generalize the unit test framework 2015-05-21 09:16:16 -04:00
timer.c sandbox: add a sandbox timer and basic test 2015-11-19 20:13:41 -07:00
usb.c test: dm: usb: Update test cases for USB 2017-10-01 16:32:51 +02:00
video.c dm: video: support increased intensity (bold) 2018-03-06 10:05:49 +01:00
wdt.c test: wdt: Add a check that dev is not NULL 2017-06-12 08:38:09 -04:00