The patches 1/3 and 2/3 are depending on the QEMU pbm patch. Together they allow using multiple PCI (virtio) devices simultaneously. Tested on installing Debian Wheezy / sparc64. http://tyom.blogspot.de/2013/03/debiansparc64-wheezy-under-qemu-how-to.html#... Without the patches the install process hangs at random places between 6% and 60%.
The patch 3/3 is a trivial rename patch.
Artyom Tarasenko (3): sparc64: use direct interrupt mapping for PCI devices sparc64: remove hacks for the "interrupts" property use the proper name for the virtio-blk devices
drivers/ide.c | 2 -- drivers/pci.c | 15 +++++++-------- drivers/pci_database.c | 6 +++--- drivers/pci_database.h | 1 - 4 files changed, 10 insertions(+), 14 deletions(-)
Every PCI Slot in PBM has 4 directly mapped IRQ lines. Use the IRQ routing schema 0bssnn (Bus, Slot, interrupt Number) described in Section 19.3.3 of UltraSPARCâ„¢-IIi User's Manual.
Please note that this patch requires the QEMU counterpart patch.
Signed-off-by: Artyom Tarasenko atar4qemu@gmail.com --- drivers/pci.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index 5c487c1..ec1a810 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -854,7 +854,14 @@ static void ob_pci_add_properties(phandle_t phandle, if (config->irq_pin) { OLDWORLD(set_int_property(dev, "AAPL,interrupts", config->irq_line)); +#if defined(CONFIG_SPARC64) + /* direct mapping bssnn (Bus, Slot, interrupt Number */ + set_int_property(get_cur_dev(), "interrupts", + ((((config->dev >> 11) << 2) + + config->irq_pin - 1) & 0x1f)); +#else NEWWORLD(set_int_property(dev, "interrupts", config->irq_pin)); +#endif }
set_int_property(dev, "min-grant", pci_config_read8(addr, PCI_MIN_GNT));
Forcing the "interrupts" property to the value of zero is not necessary, and is incompatible with the IRQ mapping schema introduced in the previous commit
Signed-off-by: Artyom Tarasenko atar4qemu@gmail.com --- drivers/ide.c | 2 -- drivers/pci.c | 8 -------- drivers/pci_database.c | 4 ++-- drivers/pci_database.h | 1 - 4 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/ide.c b/drivers/ide.c index 251db65..125b9ce 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -1432,8 +1432,6 @@ int ob_ide_init(const char *path, uint32_t io_port0, uint32_t ctl_port0, props[0]=14; props[1]=0; set_property(dnode, "interrupts", (char *)&props, 2*sizeof(props[0])); -#elif defined(CONFIG_SPARC64) - set_int_property(get_cur_dev(), "interrupts", 0); #endif
props[0] = __cpu_to_be32(chan->io_regs[0]); diff --git a/drivers/pci.c b/drivers/pci.c index ec1a810..d6b768f 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -537,14 +537,6 @@ int bridge_config_cb(const pci_config_t *config) return 0; }
-int virtio_config_cb(const pci_config_t *config) -{ -#if defined(CONFIG_SPARC64) - set_int_property(get_cur_dev(), "interrupts", 0); -#endif - return 0; -} - int ide_config_cb2 (const pci_config_t *config) { ob_ide_init(config->path, diff --git a/drivers/pci_database.c b/drivers/pci_database.c index 197f27e..dd93ea7 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -52,7 +52,7 @@ static const pci_dev_t scsi_devices[] = { NULL, "virtio-scsi", NULL, "pci1af4,1001\0pci1af4,1001\0pciclass,01018f\0", 0, 0, 0, - virtio_config_cb, NULL, + NULL, NULL, }, { 0xFFFF, 0xFFFF, @@ -134,7 +134,7 @@ static const pci_dev_t eth_devices[] = { NULL, "virtio-net", NULL, "pci1af4,1000\0pci1af4,1000\0pciclass,020000\0", 0, 0, 0, - virtio_config_cb, NULL, + NULL, NULL, }, { 0xFFFF, 0xFFFF, diff --git a/drivers/pci_database.h b/drivers/pci_database.h index 5459032..5ddbb20 100644 --- a/drivers/pci_database.h +++ b/drivers/pci_database.h @@ -28,7 +28,6 @@ struct pci_dev_t { const void *private; };
-extern int virtio_config_cb(const pci_config_t *config); extern int ide_config_cb2(const pci_config_t *config); extern int eth_config_cb(const pci_config_t *config); extern int macio_heathrow_config_cb(const pci_config_t *config);
The name 'virtio-scsi' is misleading, since there is another device called 'virtio-scsi' in QEMU. Use the name 'virtio-blk' instead.
Signed-off-by: Artyom Tarasenko atar4qemu@gmail.com --- drivers/pci_database.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pci_database.c b/drivers/pci_database.c index dd93ea7..27a28cb 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -49,7 +49,7 @@ static const pci_dev_t scsi_devices[] = { { /* Virtio-block controller */ PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_BLOCK, - NULL, "virtio-scsi", NULL, + NULL, "virtio-blk", NULL, "pci1af4,1001\0pci1af4,1001\0pciclass,01018f\0", 0, 0, 0, NULL, NULL,
Thanks, applied all.
On Sat, Apr 27, 2013 at 5:58 AM, Artyom Tarasenko atar4qemu@gmail.com wrote:
The patches 1/3 and 2/3 are depending on the QEMU pbm patch. Together they allow using multiple PCI (virtio) devices simultaneously. Tested on installing Debian Wheezy / sparc64. http://tyom.blogspot.de/2013/03/debiansparc64-wheezy-under-qemu-how-to.html#... Without the patches the install process hangs at random places between 6% and 60%.
The patch 3/3 is a trivial rename patch.
Artyom Tarasenko (3): sparc64: use direct interrupt mapping for PCI devices sparc64: remove hacks for the "interrupts" property use the proper name for the virtio-blk devices
drivers/ide.c | 2 -- drivers/pci.c | 15 +++++++-------- drivers/pci_database.c | 6 +++--- drivers/pci_database.h | 1 - 4 files changed, 10 insertions(+), 14 deletions(-)