[OpenBIOS] [PATCH 1/3] SPARC64: switch to simba PCI bridge machine configuration

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Oct 15 11:00:20 CEST 2017


Fix up the ebus device interrupt parents, plus remove deprecated code for
mapping PCI devices to the PCI root bus as this is no longer possible.

Now that the transition to a simba configuration is complete, make sure
that we update mem_base and io_base to match the start address of each
simba module, and update pci_mem_base accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 arch/sparc64/openbios.c |    2 +-
 drivers/pci.c           |   22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/sparc64/openbios.c b/arch/sparc64/openbios.c
index 71bd60c..c0e1d0d 100644
--- a/arch/sparc64/openbios.c
+++ b/arch/sparc64/openbios.c
@@ -60,7 +60,7 @@ static const struct hwdef hwdefs[] = {
             .cfg_base = APB_SPECIAL_BASE,
             .cfg_len = 0x1000000,
             .host_pci_base = APB_MEM_BASE,
-            .pci_mem_base = 0x100000, /* avoid VGA at 0xa0000 */
+            .pci_mem_base = 0x20000000, /* avoid VGA at 0xa0000 */
             .mem_len = 0xf0000000,
             .io_base = APB_SPECIAL_BASE + 0x2000000ULL, // PCI Bus I/O space
             .io_len = 0x1000000,
diff --git a/drivers/pci.c b/drivers/pci.c
index e51eaec..672dcd0 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -972,14 +972,14 @@ int ebus_config_cb(const pci_config_t *config)
     props[0] = 0x14;
     props[1] = 0x3f8;
     props[2] = 1;
-    props[3] = find_dev("/");
+    props[3] = find_dev("/pci");
     props[4] = 0x2b;
     
     /* PS2 keyboard */
     props[5] = 0x14;
     props[6] = 0x60;
     props[7] = 1;
-    props[8] = find_dev("/");
+    props[8] = find_dev("/pci");
     props[9] = 0x29;
     
     set_property(dev, "interrupt-map", (char *)props, 10 * sizeof(props[0]));
@@ -1427,9 +1427,17 @@ static void ob_scan_sabre_pci_bus(int *bus_num, unsigned long *mem_base,
 		is_multi = 0;
 		
 		if (devnum == 1) {
+			/* Force io_base/mem_base to match the pciA simba range */
+			*io_base = 0x0;       /* because of arch->iobase */
+			*mem_base = 0x20000000;
+			
 			ob_configure_pci_device(path, bus_num, mem_base, io_base,
 				bus, 1, 1, &is_multi);
 			
+			/* Force io_base/mem_base to match the pciB simba range */
+			*io_base = 0x800000;  /* because of arch->iobase */
+			*mem_base = 0x60000000;
+			
 			ph = ob_configure_pci_device(path, bus_num, mem_base, io_base,
 				bus, 1, 0, &is_multi);
 			
@@ -1815,13 +1823,11 @@ static phandle_t ob_pci_host_set_interrupt_map(phandle_t host)
            
 static void ob_pci_host_bus_interrupt(ucell dnode, u32 *props, int *ncells, u32 addr, u32 intno)
 {
-    /* Note: this can be removed when the Simba bridges are in place
+    /* Note: this is invalid when the Simba bridges are in place
        as it is impossible to physically plug hardware into the PCI
-       root bus */
-    *ncells += pci_encode_phys_addr(props + *ncells, 0, 0, addr, 0, 0);
-    props[(*ncells)++] = intno;
-    props[(*ncells)++] = dnode;
-    props[(*ncells)++] = SUN4U_PCIAINTERRUPT(addr, intno);
+       root bus (and no hardware support for mapping these interrupts
+       either) */
+    return;
 }
 
 #else
-- 
1.7.10.4




More information about the OpenBIOS mailing list