hvmloader: Relocate the etherboot ROM to be near the end of VGA
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 24 Nov 2008 11:17:44 +0000 (11:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 24 Nov 2008 11:17:44 +0000 (11:17 +0000)
BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM
at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be
fragments, which makes it hard to find enough space to hold another
Option ROM.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
tools/firmware/hvmloader/config.h
tools/firmware/hvmloader/hvmloader.c

index 32011cd5a1a1bc6aaf1473ed2d24c88cd459b14f..ea0c435ae47960b86beb751bf557074cfc60fb91 100644 (file)
@@ -23,7 +23,6 @@
 /* Memory map. */
 #define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
 #define VGABIOS_PHYSICAL_ADDRESS      0x000C0000
-#define ETHERBOOT_PHYSICAL_ADDRESS    0x000D0000
 #define SMBIOS_PHYSICAL_ADDRESS       0x000E9000
 #define SMBIOS_MAXIMUM_SIZE           0x00001000
 #define ACPI_PHYSICAL_ADDRESS         0x000EA000
index 9dff7cc08dbd7bb57a753897a6fc4da6be20328a..c8c2719a6ca50ca41a1f5497ac5cce2e7e3cf12e 100644 (file)
@@ -462,7 +462,7 @@ static uint16_t init_xen_platform_io_base(void)
 int main(void)
 {
     int vgabios_sz = 0, etherboot_sz = 0, rombios_sz, smbios_sz;
-    uint32_t vga_ram = 0;
+    uint32_t etherboot_phys_addr, vga_ram = 0;
     uint16_t xen_pfiob;
 
     printf("HVM Loader\n");
@@ -516,7 +516,10 @@ int main(void)
         printf("VGA RAM at %08x\n", vga_ram);
     }
 
-    etherboot_sz = scan_etherboot_nic((void*)ETHERBOOT_PHYSICAL_ADDRESS);
+    /* Ethernet ROM is placed after VGA ROM, on next 2kB boundary. */
+    etherboot_phys_addr =
+        (VGABIOS_PHYSICAL_ADDRESS + vgabios_sz + 2047) & ~2047;
+    etherboot_sz = scan_etherboot_nic((void *)etherboot_phys_addr);
 
     if ( get_acpi_enabled() )
     {
@@ -533,8 +536,8 @@ int main(void)
                VGABIOS_PHYSICAL_ADDRESS + vgabios_sz - 1);
     if ( etherboot_sz )
         printf(" %05x-%05x: Etherboot ROM\n",
-               ETHERBOOT_PHYSICAL_ADDRESS,
-               ETHERBOOT_PHYSICAL_ADDRESS + etherboot_sz - 1);
+               etherboot_phys_addr,
+               etherboot_phys_addr + etherboot_sz - 1);
     if ( smbios_sz )
         printf(" %05x-%05x: SMBIOS tables\n",
                SMBIOS_PHYSICAL_ADDRESS,