diff options
author | Simon Glass <sjg@chromium.org> | 2014-12-29 19:32:24 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-01-23 17:24:15 -0700 |
commit | bdc88d4eb31e2bc84afb427c216c79e87a4233ef (patch) | |
tree | c376f7c41737461e4dceab1bc65c98b5f0ec365f /drivers/pci/pci_rom.c | |
parent | 40305240c66ab5e3725c131e321402c7dfe687a2 (diff) | |
download | u-boot-bdc88d4eb31e2bc84afb427c216c79e87a4233ef.tar.gz |
x86: Support ROMs on other archs
We shouldn't assume that the VGA ROM can always be loaded at c0000. This
is only true on x86 machines.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/pci/pci_rom.c')
-rw-r--r-- | drivers/pci/pci_rom.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 86f0e95cd5..124b730271 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -157,7 +157,13 @@ int pci_rom_load(uint16_t class, struct pci_rom_header *rom_header, rom_size = rom_header->size * 512; +#ifdef PCI_VGA_RAM_IMAGE_START target = (void *)PCI_VGA_RAM_IMAGE_START; +#else + target = (void *)malloc(rom_size); + if (!target) + return -ENOMEM; +#endif if (target != rom_header) { ulong start = get_timer(0); |