Skip to contentSkip to conversation

ppc440_pcix: Do not expose a bridge device on PCI bus

PATCH Superseded BALATON Zoltan 2 participants 6 messages Apr 9, 2024 – Apr 17, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc440_pcix: Do not expose a bridge device on PCI bus

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

 hw/pci-host/ppc440_pcix.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
hw/pci-host/ppc440_pcix.c +1 -13
index 1926ae2a27..ba38172989 100644
@@ -52,7 +52,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(PPC440PCIXState, PPC440_PCIX_HOST)
 struct PPC440PCIXState {
     PCIHostState parent_obj;
 
-    PCIDevice *dev;
     struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
     struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
     uint32_t sts;
@@ -170,10 +169,6 @@ static void ppc440_pcix_reg_write4(void *opaque, hwaddr addr,
 
     trace_ppc440_pcix_reg_write(addr, val, size);
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        stl_le_p(s->dev->config + addr, val);
-        break;
-
     case PCIX0_POM0LAL:
         s->pom[0].la &= 0xffffffff00000000ULL;
         s->pom[0].la |= val;
@@ -301,10 +296,6 @@ static uint64_t ppc440_pcix_reg_read4(void *opaque, hwaddr addr,
     uint32_t val;
 
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        val = ldl_le_p(s->dev->config + addr);
-        break;
-
     case PCIX0_POM0LAL:
         val = s->pom[0].la;
         break;
@@ -498,10 +489,7 @@ static void ppc440_pcix_realize(DeviceState *dev, Error **errp)
     memory_region_init(&s->iomem, OBJECT(dev), "pci-io", 64 * KiB);
     h->bus = pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq,
                          ppc440_pcix_map_irq, &s->irq, &s->busmem, &s->iomem,
-                         PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
-
-    s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0),
-                               TYPE_PPC4xx_HOST_BRIDGE);
+                         PCI_DEVFN(1, 0), 1, TYPE_PCI_BUS);
 
     memory_region_init(&s->bm, OBJECT(s), "bm-ppc440-pcix", UINT64_MAX);
     memory_region_add_subregion(&s->bm, 0x0, &s->busmem);
Signature · 1 line
2.30.9
#1 lore raw
Quoted 10 lines · BALATON Zoltan

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

Is it a regression? Does it have a fixes: or resolves: tag?

Unless we broke it in this cycle, I would be inclined to wait, and we can ask to put it in stable.

Thanks,
Nick

Quoted 50 lines
 hw/pci-host/ppc440_pcix.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
hw/pci-host/ppc440_pcix.c +1 -13
index 1926ae2a27..ba38172989 100644
@@ -52,7 +52,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(PPC440PCIXState, PPC440_PCIX_HOST)
 struct PPC440PCIXState {
     PCIHostState parent_obj;
 
-    PCIDevice *dev;
     struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
     struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
     uint32_t sts;
@@ -170,10 +169,6 @@ static void ppc440_pcix_reg_write4(void *opaque, hwaddr addr,
 
     trace_ppc440_pcix_reg_write(addr, val, size);
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        stl_le_p(s->dev->config + addr, val);
-        break;
-
     case PCIX0_POM0LAL:
         s->pom[0].la &= 0xffffffff00000000ULL;
         s->pom[0].la |= val;
@@ -301,10 +296,6 @@ static uint64_t ppc440_pcix_reg_read4(void *opaque, hwaddr addr,
     uint32_t val;
 
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        val = ldl_le_p(s->dev->config + addr);
-        break;
-
     case PCIX0_POM0LAL:
         val = s->pom[0].la;
         break;
@@ -498,10 +489,7 @@ static void ppc440_pcix_realize(DeviceState *dev, Error **errp)
     memory_region_init(&s->iomem, OBJECT(dev), "pci-io", 64 * KiB);
     h->bus = pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq,
                          ppc440_pcix_map_irq, &s->irq, &s->busmem, &s->iomem,
-                         PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
-
-    s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0),
-                               TYPE_PPC4xx_HOST_BRIDGE);
+                         PCI_DEVFN(1, 0), 1, TYPE_PCI_BUS);
 
     memory_region_init(&s->bm, OBJECT(s), "bm-ppc440-pcix", UINT64_MAX);
     memory_region_add_subregion(&s->bm, 0x0, &s->busmem);
#2 lore raw
Quoted 12 lines · Nicholas Piggin
Quoted 10 lines · BALATON Zoltan

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

Quoted 4 lines

Is it a regression? Does it have a fixes: or resolves: tag?

Unless we broke it in this cycle, I would be inclined to wait, and we can ask to put it in stable.

It's not something that broke in this cycle but since this does not affect anything else than sam460ex I think it's OK to change this for 9.0. The changes to 440 tlb in this cycle made sam460ex more useful to run AmigaOS and this fixes the file system driver on it so it would make 9.0 really usable. Otherwise people would have to wait longer until August or install a stable update. Since this has low chance to break anything (tested with AmogaOS and Linux and MorphOS does not boot due to do_io changes anyway) I don't think we have to wait with this.

Regards,
BALATON Zoltan

Quoted 56 lines

Thanks,
Nick

Quoted 50 lines
 hw/pci-host/ppc440_pcix.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
hw/pci-host/ppc440_pcix.c +1 -13
index 1926ae2a27..ba38172989 100644
@@ -52,7 +52,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(PPC440PCIXState, PPC440_PCIX_HOST)
 struct PPC440PCIXState {
     PCIHostState parent_obj;
 
-    PCIDevice *dev;
     struct PLBOutMap pom[PPC440_PCIX_NR_POMS];
     struct PLBInMap pim[PPC440_PCIX_NR_PIMS];
     uint32_t sts;
@@ -170,10 +169,6 @@ static void ppc440_pcix_reg_write4(void *opaque, hwaddr addr,
 
     trace_ppc440_pcix_reg_write(addr, val, size);
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        stl_le_p(s->dev->config + addr, val);
-        break;
-
     case PCIX0_POM0LAL:
         s->pom[0].la &= 0xffffffff00000000ULL;
         s->pom[0].la |= val;
@@ -301,10 +296,6 @@ static uint64_t ppc440_pcix_reg_read4(void *opaque, hwaddr addr,
     uint32_t val;
 
     switch (addr) {
-    case PCI_VENDOR_ID ... PCI_MAX_LAT:
-        val = ldl_le_p(s->dev->config + addr);
-        break;
-
     case PCIX0_POM0LAL:
         val = s->pom[0].la;
         break;
@@ -498,10 +489,7 @@ static void ppc440_pcix_realize(DeviceState *dev, Error **errp)
     memory_region_init(&s->iomem, OBJECT(dev), "pci-io", 64 * KiB);
     h->bus = pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq,
                          ppc440_pcix_map_irq, &s->irq, &s->busmem, &s->iomem,
-                         PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
-
-    s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0),
-                               TYPE_PPC4xx_HOST_BRIDGE);
+                         PCI_DEVFN(1, 0), 1, TYPE_PCI_BUS);
 
     memory_region_init(&s->bm, OBJECT(s), "bm-ppc440-pcix", UINT64_MAX);
     memory_region_add_subregion(&s->bm, 0x0, &s->busmem);
#3 lore raw
Quoted 18 lines · BALATON Zoltan
Quoted 12 lines · Nicholas Piggin
Quoted 10 lines · BALATON Zoltan

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

Quoted 4 lines

Is it a regression? Does it have a fixes: or resolves: tag?

Unless we broke it in this cycle, I would be inclined to wait, and we can ask to put it in stable.

Quoted 8 lines

It's not something that broke in this cycle but since this does not affect anything else than sam460ex I think it's OK to change this for 9.0. The changes to 440 tlb in this cycle made sam460ex more useful to run AmigaOS and this fixes the file system driver on it so it would make 9.0 really usable. Otherwise people would have to wait longer until August or install a stable update. Since this has low chance to break anything (tested with AmogaOS and Linux and MorphOS does not boot due to do_io changes anyway) I don't think we have to wait with this.

Hey, travelling / at a conference / on vacation for the next couple of weeks.

It's just a bit late for hard freeze IMO, since we didn't break it before the prior release or a bad security / crash bug. Will put it in 9.1.

Thanks,
Nick

#4 lore raw
Quoted 28 lines · Nicholas Piggin
Quoted 18 lines · BALATON Zoltan
Quoted 12 lines · Nicholas Piggin
Quoted 10 lines · BALATON Zoltan

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

Quoted 4 lines

Is it a regression? Does it have a fixes: or resolves: tag?

Unless we broke it in this cycle, I would be inclined to wait, and we can ask to put it in stable.

Quoted 8 lines

It's not something that broke in this cycle but since this does not affect anything else than sam460ex I think it's OK to change this for 9.0. The changes to 440 tlb in this cycle made sam460ex more useful to run AmigaOS and this fixes the file system driver on it so it would make 9.0 really usable. Otherwise people would have to wait longer until August or install a stable update. Since this has low chance to break anything (tested with AmogaOS and Linux and MorphOS does not boot due to do_io changes anyway) I don't think we have to wait with this.

Quoted 6 lines

Hey, travelling / at a conference / on vacation for the next couple of weeks.

It's just a bit late for hard freeze IMO, since we didn't break it before the prior release or a bad security / crash bug. Will put it in 9.1.

Philippe already queued this (and another) patch. This fixes AmigaOS on sam460ex which became usable with the tlbwe changes in this cycle but it's not really usable without a file system driver that this patch fixes. Please allow this in 9.0 so users who want to try it don't have to wait a few months more. Sorry for sending it this late but it was reported late and took time to debug it.

Regards,
BALATON Zoltan

#5 lore raw
Quoted 36 lines · BALATON Zoltan
Quoted 28 lines · Nicholas Piggin
Quoted 18 lines · BALATON Zoltan
Quoted 12 lines · Nicholas Piggin
Quoted 10 lines · BALATON Zoltan

Real 460EX SoC apparently does not expose a bridge device and having it appear on PCI bus confuses an AmigaOS file system driver that uses this to detect which machine it is running on. Since values written here by firmware are never read, just ignore these writes and drop the bridge device.

---
This is only used by sam460ex and this fixes an issue with AmigaOS on this machine so I'd like this to be merged for 9.0 please.

Quoted 4 lines

Is it a regression? Does it have a fixes: or resolves: tag?

Unless we broke it in this cycle, I would be inclined to wait, and we can ask to put it in stable.

Quoted 8 lines

It's not something that broke in this cycle but since this does not affect anything else than sam460ex I think it's OK to change this for 9.0. The changes to 440 tlb in this cycle made sam460ex more useful to run AmigaOS and this fixes the file system driver on it so it would make 9.0 really usable. Otherwise people would have to wait longer until August or install a stable update. Since this has low chance to break anything (tested with AmogaOS and Linux and MorphOS does not boot due to do_io changes anyway) I don't think we have to wait with this.

Quoted 6 lines

Hey, travelling / at a conference / on vacation for the next couple of weeks.

It's just a bit late for hard freeze IMO, since we didn't break it before the prior release or a bad security / crash bug. Will put it in 9.1.

Quoted 6 lines

Philippe already queued this (and another) patch. This fixes AmigaOS on sam460ex which became usable with the tlbwe changes in this cycle but it's not really usable without a file system driver that this patch fixes. Please allow this in 9.0 so users who want to try it don't have to wait a few months more. Sorry for sending it this late but it was reported late and took time to debug it.

No worries, I don't have a problem with the patch so if Philippe thinks it's okay then I'm fine with that.

Thanks,
Nick