It looks as if the sun4u sabre/simba patchset is close to being merged into QEMU, so here are the related changes queued for OpenBIOS. All of the patches except the last have previously been posted on-list.
Since QEMU freeze is coming up soon I plan to apply these as soon as possible once the QEMU changes land upstream.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (3): SPARC64: switch to simba PCI bridge machine configuration pci: set cmd646 name and device_type properties to "ide" pci: set sunhme name to "network"
arch/sparc64/openbios.c | 2 +- drivers/pci.c | 22 ++++++++++++++-------- drivers/pci_database.c | 4 ++-- 3 files changed, 17 insertions(+), 11 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 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
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 999b42b..5daf23b 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,
This brings the device tree in agreement with a real Ultra 5.
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 5daf23b..4d656ef 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -142,7 +142,7 @@ static const pci_dev_t eth_devices[] = { }, { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HME, - NULL, "sunhme", NULL, "SUNW,hme\0", + NULL, "ethernet", NULL, "SUNW,hme\0", 0, 0, 0, sunhme_config_cb, "ethernet", },