From: Keir Fraser Date: Mon, 24 Nov 2008 11:17:44 +0000 (+0000) Subject: hvmloader: Relocate the etherboot ROM to be near the end of VGA X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14043^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=66d936fdab1e4da0c2ef6e32e24362a26d1a343a;p=xen.git hvmloader: Relocate the etherboot ROM to be near the end of VGA 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 --- diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h index 32011cd5a1..ea0c435ae4 100644 --- a/tools/firmware/hvmloader/config.h +++ b/tools/firmware/hvmloader/config.h @@ -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 diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index 9dff7cc08d..c8c2719a6c 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -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,