diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-09-12 13:44:13 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-10-09 14:07:07 +1100 |
commit | ee2dfa308633ee107574923166b3981d72f92f05 (patch) | |
tree | 27e572a3ba74ff173573d444f63c0efabb77ca26 | |
parent | 8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34 (diff) | |
download | SLOF-ee2dfa308633ee107574923166b3981d72f92f05.zip SLOF-ee2dfa308633ee107574923166b3981d72f92f05.tar.gz SLOF-ee2dfa308633ee107574923166b3981d72f92f05.tar.bz2 |
fdt: introduce fdt-init
Current fdt.fs takes device-tree start address from fdt-start,
this needs to be made generic for parsing device tree at later
point
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
-rw-r--r-- | board-qemu/slof/fdt.fs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs index c67c3c9..13f7ead 100644 --- a/board-qemu/slof/fdt.fs +++ b/board-qemu/slof/fdt.fs @@ -36,14 +36,21 @@ h# 4 constant OF_DT_NOP h# 9 constant OF_DT_END \ Create some variables early -fdt-start -dup dup >fdth_struct_off l@ + value fdt-struct -dup dup >fdth_string_off l@ + value fdt-strings -drop +0 value fdt-start-addr +0 value fdt-struct +0 value fdt-strings + +: fdt-init ( fdt-start -- ) + dup to fdt-start-addr + dup dup >fdth_struct_off l@ + to fdt-struct + dup dup >fdth_string_off l@ + to fdt-strings + drop +; +fdt-start fdt-init \ Dump fdt header for all to see and check FDT validity : fdt-check-header ( -- ) - fdt-start dup 0 = IF + fdt-start-addr dup 0 = IF ." No flat device tree !" cr drop -1 throw EXIT THEN hex fdt-debug IF @@ -226,7 +233,7 @@ fdt-parse-memory \ Claim fdt memory and reserve map : fdt-claim-reserve - fdt-start + fdt-start-addr dup dup >fdth_tsize l@ 0 claim drop dup >fdth_rsvmap_off l@ + BEGIN |