u-boot-brain/drivers
Stephen Warren 02464e386b fdt: add new fdt address parsing functions
fdtdec_get_addr_size() hard-codes the number of cells used to represent
an address or size in DT. This is incorrect in many cases depending on
the DT binding for a particular node or property (e.g. it is incorrect
for the "reg" property). In most cases, DT parsing code must use the
properties #address-cells and #size-cells to parse addres properties.

This change splits up the implementation of fdtdec_get_addr_size() so
that the core logic can be used for both hard-coded and non-hard-coded
cases. Various wrapper functions are implemented that support cases
where hard-coded cell counts should or should not be used, and where
the client does and doesn't know the parent node ID that contains the
properties #address-cells and #size-cells.

dev_get_addr() is updated to use the new functions.

Core functionality in fdtdec_get_addr_size_fixed() is widely tested via
fdtdec_get_addr_size(). I tested fdtdec_get_addr_size_auto_noparent() and
dev_get_addr() by manually modifying the Tegra I2C driver to invoke them.

Much of the core implementation of fdtdec_get_addr_size_fixed(),
fdtdec_get_addr_size_auto_parent(), and
fdtdec_get_addr_size_auto_noparent() comes from Thierry Reding's
previous commit "fdt: Fix fdtdec_get_addr_size() for 64-bit".

Based-on-work-by: Thierry Reding <treding@nvidia.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michal Suchanek <hramrach@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Dropped #define DEBUG at the top of fdtdec.c:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-09-15 07:57:13 -06:00
..
bios_emulator biosemu: Do not free vga_info->BIOSImage when it is 0xc0000 2015-04-29 18:51:49 -06:00
block Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header 2015-09-11 17:15:20 -04:00
bootcount qe: move immap_qe.h from arch directory into common directory 2014-07-22 16:25:54 -07:00
clk rockchip: rk3288: Add clock driver 2015-09-02 21:28:23 -06:00
core fdt: add new fdt address parsing functions 2015-09-15 07:57:13 -06:00
cpu x86: Move MP initialization codes into a common place 2015-07-14 18:03:16 -06:00
crypto Correct License and Copyright information on few files 2015-08-12 20:47:46 -04:00
ddr bitops: introduce BIT() definition 2015-09-11 17:15:32 -04:00
demo drivers: hierarchize drivers Kconfig menu 2015-08-12 20:47:44 -04:00
dfu dfu: mmc: buffer file reads too 2015-09-11 17:15:23 -04:00
dma dma: lpc32xx: add DMA driver 2015-08-18 13:45:55 -04:00
fpga arm: socfpga: Fix FPGA bitstream programming routine 2015-08-08 14:14:04 +02:00
gpio Merge branch 'rmobile' of git://git.denx.de/u-boot-sh 2015-09-13 17:25:16 -04:00
hwmon dtt: add ds620 support 2015-04-10 14:23:23 +02:00
i2c rockchip: Add I2C driver 2015-09-02 21:28:24 -06:00
input x86: i8042: Correctly initialize the controller 2015-08-26 07:54:16 -07:00
led dm: led: Tidy up SPL options for the led and led-gpio 2015-09-02 21:28:22 -06:00
memory ARM: keystone: aemif: move aemif driver to drivers/memory/ti-aemif.c 2014-06-19 17:53:58 -04:00
misc driver: misc: correct Kconfig entry 2015-09-11 14:05:34 -04:00
mmc Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header 2015-09-11 17:15:20 -04:00
mtd bitops: introduce BIT() definition 2015-09-11 17:15:32 -04:00
net Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header 2015-09-11 17:15:20 -04:00
pci pcie_imx: Use 'ms' for milliseconds 2015-09-13 11:04:53 +02:00
pcmcia powerpc: mpc824x: remove MPC824X cpu support 2015-01-05 12:08:55 -05:00
pinctrl rockchip: rk3288: Add pinctrl driver 2015-09-02 21:28:24 -06:00
power Merge git://git.denx.de/u-boot-rockchip 2015-09-03 14:57:09 -04:00
pwm pwm: imx: Remove unreachable code 2015-05-26 14:13:12 +02:00
qe driver/qe: use strncpy instead of strcpy 2015-08-03 12:06:36 -07:00
ram ram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM 2015-08-18 13:46:02 -04:00
rtc rtc:ds3232/ds3231: Add support to generate 32KHz output 2015-09-01 21:37:23 -05:00
serial Merge branch 'rmobile' of git://git.denx.de/u-boot-sh 2015-09-13 17:25:16 -04:00
soc soc: keystone_serdes: generalize configuration mechanism 2014-10-23 11:27:28 -04:00
sound of: clean up OF_CONTROL ifdef conditionals 2015-08-18 13:46:05 -04:00
spi bitops: introduce BIT() definition 2015-09-11 17:15:32 -04:00
thermal thermal: imx_thermal: Do not print on error 2015-09-13 10:49:21 +02:00
tpm dm: tpm: Convert LPC driver to driver model 2015-08-31 07:57:28 -06:00
twserial drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
usb usb: ci_udc: fix emissions of ZLPs 2015-09-12 20:24:42 +02:00
video bitops: introduce BIT() definition 2015-09-11 17:15:32 -04:00
watchdog imx: imx7d: add imx-common cpu support for imx7d 2015-09-13 10:11:54 +02:00
Kconfig pinctrl: add pin control uclass support 2015-08-31 07:57:29 -06:00
Makefile pinctrl: add pin control uclass support 2015-08-31 07:57:29 -06:00