fdtdec: add function: fdtdec_decode_memory()
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 28 Jul 2014 09:16:47 +0000 (11:16 +0200)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 15 Jan 2015 06:35:40 +0000 (15:35 +0900)
commit18216ebbeb66cf8990ab36051b23c32f0e23b796
treefaab86669019233d7f093aa15764bc78298815ca
parent29366158b05e75dcfe813a3fe22d7e4958dddab0
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