[SeaBIOS] (no subject)

Jason Baron jbaron at redhat.com
Thu Sep 13 22:12:14 CEST 2012


jan.kiszka at siemens.com, juzhang at redhat.com, agraf at suse.de, yamahata at valinux.co.jp, mkletzan at redhat.com, afaerber at suse.de, armbru at redhat.com, lcapitulino at redhat.com, alex.williamson at redhat.com
Message-Id: <e9be57cd1e9aba8c97fc1518055a05e28533904c.1347565443.git.jbaron at redhat.com>
In-Reply-To: <cover.1347565443.git.jbaron at redhat.com>
References: <cover.1347565443.git.jbaron at redhat.com>
Subject: [PATCH 2/9] seabios: pciinit: initialize pcimem_start and pcimem_end depending on chipset.

From: Isaku Yamahata <yamahata at valinux.co.jp>

initialize pcimem_start and pcimem_end based on chipset.

[jbaron at redhat.com: re-structured to current seabios]
Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp>
Signed-off-by: Jason Baron <jbaron at 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();
 
-- 
1.7.1




More information about the SeaBIOS mailing list