summaryrefslogtreecommitdiff
path: root/src/devices/oprom/yabel/biosemu.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-01-13 11:38:46 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2011-01-13 11:38:46 +0000
commit9144304771be6cc89fcd010a0c8bc123bb750cfc (patch)
tree1ad3642b709324c910e6fffbb677698c6937b189 /src/devices/oprom/yabel/biosemu.c
parentfe7d6b9a4a784f0b92b3c9dc5b6c6070b4c2e10c (diff)
Improve compatibility of YABEL with real-world VGABIOSes
Some of them do weird things to the option rom region (mapping registers there or so) which failed as we handled these memory region in emulation. As they were copied back to real memory after the emulation was done, we can just as well use real memory directly for these regions. This affects IVT, BDA, and option ROM space. Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Acked-by: Joseph Smith <joe@settoplinux.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6251 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/oprom/yabel/biosemu.c')
-rw-r--r--src/devices/oprom/yabel/biosemu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/devices/oprom/yabel/biosemu.c b/src/devices/oprom/yabel/biosemu.c
index 9cdd0f279b..3a8eea62ed 100644
--- a/src/devices/oprom/yabel/biosemu.c
+++ b/src/devices/oprom/yabel/biosemu.c
@@ -106,6 +106,9 @@ biosemu(u8 *biosmem, u32 biosmem_size, struct device * dev, unsigned long rom_ad
printf("Error: Device Expansion ROM invalid!\n");
return -1;
}
+ biosemu_add_special_memory(0, 0x500); // IVT + BDA
+ biosemu_add_special_memory(OPTION_ROM_CODE_SEGMENT << 4, 0x10000); // option ROM
+
rom_image = (u8 *) bios_device.img_addr;
DEBUG_PRINTF("executing rom_image from %p\n", rom_image);
DEBUG_PRINTF("biosmem at %p\n", biosmem);
@@ -129,7 +132,7 @@ biosemu(u8 *biosmem, u32 biosmem_size, struct device * dev, unsigned long rom_ad
// copy expansion ROM image to segment OPTION_ROM_CODE_SEGMENT
// NOTE: this sometimes fails, some bytes are 0x00... so we compare
// after copying and do some retries...
- u8 *mem_img = biosmem + (OPTION_ROM_CODE_SEGMENT << 4);
+ u8 *mem_img = OPTION_ROM_CODE_SEGMENT << 4;
u8 copy_count = 0;
u8 cmp_result = 0;
do {
@@ -152,7 +155,7 @@ biosemu(u8 *biosmem, u32 biosmem_size, struct device * dev, unsigned long rom_ad
break;
}
clr_ci();
- *(mem_img + i) = c;
+ my_wrb(mem_img + i, c);
}
#endif
copy_count++;