Author: afaerber Date: Sat Nov 27 23:37:46 2010 New Revision: 975 URL: http://tracker.coreboot.org/trac/openbios/changeset/975
Log: ppc: Increase #address-cells for ppc64
To store a full 64-bit address we need two cells. This setting matches Apple's OpenFirmware on my G5 and IBM's firmware on the JS20.
The PCI driver zero-pads its physical addresses, so is okay as long as devices remain in lower 32 bits. ofmem needs changes for memory ranges and translations.
Note that an enlarged #size-cells is not strictly needed and constitutes a difference between Apple and IBM firmware (1 vs. 2).
v2: * Introduce local helper push_physaddr(). A more general, global definition was not easily reachable due to inability to determine in preprocessor whether phys_addr_t is wider than ucell, leading to compilation errors due to a shift the size of the variable.
Signed-off-by: Andreas Färber andreas.faerber@web.de
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c trunk/openbios-devel/arch/ppc/qemu/tree.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Sat Nov 27 18:58:30 2010 (r974) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Sat Nov 27 23:37:46 2010 (r975) @@ -191,6 +191,16 @@ } }
+/* -- phys.lo ... phys.hi */ +static void +push_physaddr(phys_addr_t value) +{ + PUSH(value); +#ifdef CONFIG_PPC64 + PUSH(value >> 32); +#endif +} + static void cpu_generic_init(const struct cpudef *cpu) { @@ -730,8 +740,7 @@
/* all memory */
- /* TODO Adjust this when #address-cells gets increased for ppc64. */ - PUSH(0); + push_physaddr(0); fword("encode-phys"); /* This needs adjusting if #size-cells gets increased. Alternatively use multiple (address, size) tuples. */
Modified: trunk/openbios-devel/arch/ppc/qemu/tree.fs ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/tree.fs Sat Nov 27 18:58:30 2010 (r974) +++ trunk/openbios-devel/arch/ppc/qemu/tree.fs Sat Nov 27 23:37:46 2010 (r975) @@ -5,13 +5,15 @@ \ as published by the Free Software Foundation \
+include config.fs + \ ------------------------------------------------------------- \ device-tree \ -------------------------------------------------------------
" /" find-device
-1 encode-int " #address-cells" property +[IFDEF] CONFIG_PPC64 2 [ELSE] 1 [THEN] encode-int " #address-cells" property 1 encode-int " #size-cells" property h# 05f5e100 encode-int " clock-frequency" property