fdtdec: add function: fdtdec_decode_memory()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 28 Jul 2014 09:16:47 +0000 (11:16 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 8 Apr 2016 02:11:21 +0000 (11:11 +0900)
commitb021c1c116c6eb7394061ea1aa544150a24342c9
tree5fca49f2507f324c5c3daf940ad25cc0fbead7d8
parent7bdc85f7e9ba4058773701a3ca55d62c69c5f7bf
fdtdec: add function: fdtdec_decode_memory()

This function can be used for decode memory node from device tree file.
Currently supports decoding of a single memory node with a multiple ranges
specified by the reg property with size of address and size cells specified
in a root node.

Function parameters:
- blob: ptr to device tree
- start: ptr to banks start address array
- size: ptr to banks size array
- max_banks: max number of banks to fill

Two of args: start or size can be NULL e.g. if only each bank size is needed.

Sample use case:
memory {
device_type = "memory";
reg = <0x40000000 ... 0x10000000 ...
       0x50000000 ... 0x10000000 ...
       ...        ... ...        ...>;
      };

Change-Id: I2f3defb89cf62d81377fb7882dbbae79b4472af2
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
include/fdtdec.h
lib/fdtdec.c