From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 29 Dec 2014 19:32:24 -0700 Subject: [U-Boot] [PATCH 03/10] x86: Support ROMs on other archs In-Reply-To: <1419906751-29776-1-git-send-email-sjg@chromium.org> References: <1419906751-29776-1-git-send-email-sjg@chromium.org> Message-ID: <1419906751-29776-4-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- arch/x86/include/asm/u-boot-x86.h | 2 ++ drivers/pci/pci_rom.c | 6 ++++++ include/pci_rom.h | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 36145cb..b98afa8 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -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_ */ diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 86f0e95..124b730 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); diff --git a/include/pci_rom.h b/include/pci_rom.h index 8b2674c..4ba36eb 100644 --- a/include/pci_rom.h +++ b/include/pci_rom.h @@ -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; -- 2.2.0.rc0.207.ga3a616c