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>
Tue, 20 Oct 2020 00:43:30 +0000 (09:43 +0900)
commit63c3f9c31ac11fdea37fc651104935b05c44b757
treed9c9f58f4ed1b03283ad0f8fe334ddcac8179973
parent91bc34d57b87eb5589d60d8a376a923ec5ec1d7d
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/dm/of_extra.h
include/fdtdec.h
lib/fdtdec.c