This is the final set of changes required to switch SPARC64 over to use the QEMU machine configuration with Simba bridges. Note that this is currently pending approval of pre-requisite patches for the corresponding sun4u patchset.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (2): SPARC64: switch to simba PCI bridge machine configuration pci: set cmd646 name and device_type properties to "ide"
arch/sparc64/openbios.c | 2 +- drivers/pci.c | 22 ++++++++++++++-------- drivers/pci_database.c | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-)
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@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 7d16f3a..92938a4 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -916,14 +916,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])); @@ -1371,9 +1371,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); @@ -1756,13 +1764,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
This is because some OSs (noticeably NetBSD) look up devices by device_type in order to establish an interrupt mapping.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci_database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci_database.c b/drivers/pci_database.c index 3155ee3..da54f62 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -65,7 +65,7 @@ static const pci_dev_t scsi_devices[] = { static const pci_dev_t ide_devices[] = { { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, /* CMD646 IDE controller */ - "pci-ide", "pci-ata", NULL, + "ide", "ide", NULL, "pci1095,646\0pci1095,646\0pciclass,01018f\0", 0, 0, 0, ide_config_cb2, NULL,