]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Support ROMs on other archs
authorSimon Glass <sjg@chromium.org>
Tue, 30 Dec 2014 02:32:24 +0000 (19:32 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 24 Jan 2015 00:24:15 +0000 (17:24 -0700)
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>
arch/x86/include/asm/u-boot-x86.h
drivers/pci/pci_rom.c
include/pci_rom.h

index 36145cb0a81552fe78aa5409100b22d93d097cb1..b98afa801d3a60849c58d01d3955965bbc5bc99d 100644 (file)
@@ -70,4 +70,6 @@ uint64_t timer_get_tsc(void);
 
 void quick_ram_check(void);
 
+#define PCI_VGA_RAM_IMAGE_START                0xc0000
+
 #endif /* _U_BOOT_I386_H_ */
index 86f0e95cd5af5cf6fd89c566950c1f0dd13025e1..124b730271d9aabb939df03c685cf5f4ea5206d2 100644 (file)
@@ -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);
 
index 8b2674cf87940fbcdd79b456695718a1f822b178..4ba36eb1b7bd079311d59523d14ad41f4d0962fc 100644 (file)
@@ -8,7 +8,6 @@
 #define _PCI_ROM_H
 
 #define PCI_ROM_HDR                    0xaa55
-#define PCI_VGA_RAM_IMAGE_START                0xc0000
 
 struct pci_rom_header {
        uint16_t signature;