ppc: Fix /memory reg property

Physical address and size were both using two cells instead of one,
and their order was wrong. This would happen to work for RAM < 4 GB,
since the clear high address bits would happen to match the zero-based
memory location. It would indicate a second bank of size zero though.

Switch the value order and use encode-phys in preparation for ppc64.

This tidies the output of the Haiku boot loader.

v2:
* Document TODOs for ppc64, requested by Alex.

Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@947 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Andreas Färber
2010-11-07 16:51:47 +00:00
committed by Andreas Färber
parent 21e461a4e7
commit 652ebc448f

View File

@@ -730,17 +730,14 @@ arch_of_init( void )
/* all memory */ /* all memory */
PUSH(ram_size >> 32); /* TODO Adjust this when #address-cells gets increased for ppc64. */
fword("encode-int"); PUSH(0);
fword("encode-phys");
/* This needs adjusting if #size-cells gets increased.
Alternatively use multiple (address, size) tuples. */
PUSH(ram_size & 0xffffffff); PUSH(ram_size & 0xffffffff);
fword("encode-int"); fword("encode-int");
fword("encode+"); fword("encode+");
PUSH(0);
fword("encode-int");
fword("encode+");
PUSH(0);
fword("encode-int");
fword("encode+");
push_str("reg"); push_str("reg");
fword("property"); fword("property");