lib/devicetree: Integrate flattened devicetree support

* Adapt to coreboot coding style.
* Use coreboot's endian conversion functions.
* Fix header and header guards.
* Get rid of unused functions.
* Add Kconfig to build it on ramstage.
* Replace size32 with ALIGN_UP and DIV_ROUND_UP.
* Add NULL pointer checks
* Convert constants to defines

Required for Cavium's BDK and uImage FIT support.

Change-Id: I6e6cd9f78fb402bd54d684097326d26eb78d552a
Signed-off-by: Patrick Rudolph <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Julius Werner <>
6 files changed