[OpenBIOS] [commit] r1082 - trunk/openbios-devel/arch/ppc/qemu

repository service svn at openbios.org
Mon Jan 7 13:57:52 CET 2013


Author: mcayland
Date: Mon Jan  7 13:57:51 2013
New Revision: 1082
URL: http://tracker.coreboot.org/trac/openbios/changeset/1082

Log:
PPC: Fix mapping of OpenBIOS ROM in RAM copy within OFMEM

The OpenBIOS ROM in RAM copy was being incorrectly mapped in OFMEM as part of
the 1:1 physical to virtual mapping used for OpenBIOS housekeeping at the top
of RAM.

Change the existing 1:1 mapping to handle everything up to the ROM in RAM copy,
and then add a separate virtual mapping for the OpenBIOS ROM in RAM address
space.

This ensures that the OpenBIOS address space mapping is now recorded in the MMU
translations property, and hence presented to client kernels to be incorporated
in their existing mapping list before taking control of the MMU.

With this patch applied, my NetBSD 5 test ISO is now able to complete a
substantial part of its kernel boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/arch/ppc/qemu/ofmem.c

Modified: trunk/openbios-devel/arch/ppc/qemu/ofmem.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/ofmem.c	Sun Jan  6 14:29:59 2013	(r1081)
+++ trunk/openbios-devel/arch/ppc/qemu/ofmem.c	Mon Jan  7 13:57:51 2013	(r1082)
@@ -553,7 +553,13 @@
     ofmem_claim_virt(0, get_ram_bottom(), 0);
     ofmem_map(0, 0, get_ram_bottom(), 0);
 
-    ofmem_claim_phys(get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
-    ofmem_claim_virt(get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
-    ofmem_map(get_ram_top(), get_ram_top(), ofmem->ramsize - get_ram_top(), 0);
+    /* Map everything at the top of physical RAM 1:1, minus the OpenBIOS ROM in RAM copy */
+    ofmem_claim_phys(get_ram_top(), get_hash_base() + HASH_SIZE - get_ram_top(), 0);
+    ofmem_claim_virt(get_ram_top(), get_hash_base() + HASH_SIZE - get_ram_top(), 0);
+    ofmem_map(get_ram_top(), get_ram_top(), get_hash_base() + HASH_SIZE - get_ram_top(), 0);
+    
+    /* Map the OpenBIOS ROM in RAM copy */
+    ofmem_claim_phys(ofmem->ramsize - OF_CODE_SIZE, OF_CODE_SIZE, 0);
+    ofmem_claim_virt(OF_CODE_START, OF_CODE_SIZE, 0);
+    ofmem_map(ofmem->ramsize - OF_CODE_SIZE, OF_CODE_START, OF_CODE_SIZE, 0);
 }



More information about the OpenBIOS mailing list