jan.kiszka@siemens.com, juzhang@redhat.com, agraf@suse.de, yamahata@valinux.co.jp, mkletzan@redhat.com, afaerber@suse.de, armbru@redhat.com, lcapitulino@redhat.com, alex.williamson@redhat.com Message-Id: e9be57cd1e9aba8c97fc1518055a05e28533904c.1347565443.git.jbaron@redhat.com In-Reply-To: cover.1347565443.git.jbaron@redhat.com References: cover.1347565443.git.jbaron@redhat.com Subject: [PATCH 2/9] seabios: pciinit: initialize pcimem_start and pcimem_end depending on chipset.
From: Isaku Yamahata yamahata@valinux.co.jp
initialize pcimem_start and pcimem_end based on chipset.
[jbaron@redhat.com: re-structured to current seabios] Signed-off-by: Isaku Yamahata yamahata@valinux.co.jp Signed-off-by: Jason Baron jbaron@redhat.com --- src/pci.h | 6 ++++++ src/pciinit.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/pci.h b/src/pci.h index fe663b8..ef0c158 100644 --- a/src/pci.h +++ b/src/pci.h @@ -156,5 +156,11 @@ extern struct pir_header *PirAddr;
#define PIR_SIGNATURE 0x52495024 // $PIR
+struct pci_mem_addr { + u64 *pcimem_start; + u64 *pcimem_end; +}; + +
#endif diff --git a/src/pciinit.c b/src/pciinit.c index 68f302a..e604fd9 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -636,6 +636,22 @@ static void pci_bios_map_devices(struct pci_bus *busses) * Main setup code ****************************************************************/
+ +void i440fx_mem_addr_init(struct pci_device *dev, void *arg) +{ + struct pci_mem_addr *addr = arg; + + *(addr->pcimem_start) = BUILD_PCIMEM_START; + *(addr->pcimem_end) = BUILD_PCIMEM_END; +} + + +static const struct pci_device_id pci_mem_addr_tbl[] = { + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, + i440fx_mem_addr_init), + PCI_DEVICE_END, +}; + void pci_setup(void) { @@ -653,6 +669,13 @@ pci_setup(void) } pci_bios_init_bus();
+ struct pci_mem_addr addr = { + .pcimem_start = &pcimem_start, + .pcimem_end = &pcimem_end, + }; + pci_find_init_device(pci_mem_addr_tbl, &addr); + + dprintf(1, "=== PCI device probing ===\n"); pci_probe_devices();