Skip to content
Snippets Groups Projects
  1. Jan 04, 2022
    • Daniel Henrique Barboza's avatar
      pnv_phb4.c: do not set 'root-bus' as bus name · 9747d061
      Daniel Henrique Barboza authored
      
      This change has the same motivation as the one done for pnv-phb3-root-bus
      buses previously. Defaulting every bus to 'root-bus' makes it impossible to attach
      root ports to specific buses and it doesn't allow for custom bus
      naming because we're ignoring the 'id' value when registering the root
      bus.
      
      After this patch, creating pnv-phb4 devices with 'id' being set will
      result in the following qtree:
      
      qemu-system-ppc64 -m 4G -machine powernv9,accel=tcg \
         -device pnv-phb4,chip-id=0,index=0,id=pcie.0 \
         -device pnv-phb4,chip-id=1,index=4,id=pcie.1
      
      bus: main-system-bus
        type System
        dev: pnv-phb4, id "pcie.1"
          index = 4 (0x4)
          chip-id = 1 (0x1)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pcie.1
            type pnv-phb4-root-bus
        dev: pnv-phb4, id "pcie.0"
          index = 0 (0x0)
          chip-id = 0 (0x0)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pcie.0
            type pnv-phb4-root-bus
      
      And without setting any ids:
      
      qemu-system-ppc64 -m 4G -machine powernv9,accel=tcg \
         -device pnv-phb4,chip-id=0,index=0,id=pcie.0 \
         -device pnv-phb4,chip-id=1,index=4,id=pcie.1
      
      bus: main-system-bus
        type System
        dev: pnv-phb4, id ""
          index = 4 (0x4)
          chip-id = 1 (0x1)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root-bus.1
            type pnv-phb4-root-bus
        dev: pnv-phb4, id ""
          index = 0 (0x0)
          chip-id = 0 (0x0)
          version = 704374636546 (0xa400000002)
          device-id = 1217 (0x4c1)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb4-root-bus.0
            type pnv-phb4-root-bus
      
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-Id: <20211228193806.1198496-17-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      9747d061
    • Daniel Henrique Barboza's avatar
      pnv_phb3.c: do not set 'root-bus' as bus name · dec4e289
      Daniel Henrique Barboza authored
      
      All pnv-phb3-root-bus buses are being created as 'root-bus'. This
      makes it impossible to, for example, add a pnv-phb3-root-port in
      a specific root bus, since they all have the same name. By default
      the device will be parented by the pnv-phb3 device that precedeced it in
      the QEMU command line.
      
      Moreover, this doesn't all for custom bus naming. Libvirt, for instance,
      likes to name these buses as 'pcie.N', where 'N' is the index value of
      the controller in the domain XML, by using the 'id' command line
      attribute. At this moment this is also being ignored - the created root
      bus will always be named 'root-bus'.
      
      This patch fixes both scenarios by removing the 'root-bus' name from the
      pci_register_root_bus() call. If an "id" is provided, use that.
      Otherwise use 'NULL' as bus name. The 'NULL' value will be handled in
      qbus_init_internal() and it will defaulted as lowercase bus type + the
      global bus_id value.
      
      After this path we can define the bus name by using the 'id' attribute:
      
      qemu-system-ppc64 -m 4G -machine powernv8,accel=tcg \
          -device pnv-phb3,chip-id=0,index=1,id=pcie.0
      
        dev: pnv-phb3, id "pcie.0"
          index = 1 (0x1)
          chip-id = 0 (0x0)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pcie.0
            type pnv-phb3-root-bus
      
      And without an 'id' we will have the following default:
      
      qemu-system-ppc64 -m 4G -machine powernv8,accel=tcg \
          -device pnv-phb3,chip-id=0,index=1
      
        dev: pnv-phb3, id ""
          index = 1 (0x1)
          chip-id = 0 (0x0)
          x-config-reg-migration-enabled = true
          bypass-iommu = false
          bus: pnv-phb3-root-bus.0
            type pnv-phb3-root-bus
      
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-Id: <20211228193806.1198496-3-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      dec4e289
    • Cédric Le Goater's avatar
      ppc/pnv: Remove the PHB4 "device-id" property · c42b9c8b
      Cédric Le Goater authored
      
      It's unused.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20211222063817.1541058-4-clg@kaod.org>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      c42b9c8b
    • Cédric Le Goater's avatar
      ppc/pnv: Remove PHB4 reset handler · 81fbb57b
      Cédric Le Goater authored
      
      The PHB4 reset handler was preparing ground for PHB5 to set
      appropriately the device id. We don't need it for the PHB4 since the
      device id is already set in the root port complex. PH5 will introduce
      its own.
      
      "device-id" property is now useless. It should be removed.
      
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20211222063817.1541058-3-clg@kaod.org>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      81fbb57b
  2. Dec 30, 2021
  3. Dec 17, 2021
  4. Oct 30, 2021
  5. Oct 21, 2021
  6. Sep 30, 2021
  7. Sep 04, 2021
  8. Aug 03, 2021
  9. Jul 26, 2021
  10. Jul 20, 2021
  11. Jul 16, 2021
  12. Jul 13, 2021
  13. Jul 11, 2021
  14. Jul 03, 2021
  15. Jul 02, 2021
    • Philippe Mathieu-Daudé's avatar
      hw/pci-host/bonito: Allow PCI config accesses smaller than 32-bit · 711ef337
      Philippe Mathieu-Daudé authored
      When running the official PMON firmware for the Fuloong 2E, we see
      8-bit and 16-bit accesses to PCI config space:
      
        $ qemu-system-mips64el -M fuloong2e -bios pmon_2e.bin \
          -trace -trace bonito\* -trace pci_cfg\*
      
        pci_cfg_write vt82c686b-pm 05:4 @0x90 <- 0xeee1
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x4d2, size: 2
        pci_cfg_write vt82c686b-pm 05:4 @0xd2 <- 0x1
        pci_cfg_write vt82c686b-pm 05:4 @0x4 <- 0x1
        pci_cfg_write vt82c686b-isa 05:0 @0x4 <- 0x7
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x81, size: 1
        pci_cfg_read vt82c686b-isa 05:0 @0x81 -> 0x0
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x81, size: 1
        pci_cfg_write vt82c686b-isa 05:0 @0x81 <- 0x80
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x83, size: 1
        pci_cfg_write vt82c686b-isa 05:0 @0x83 <- 0x89
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x85, size: 1
        pci_cfg_write vt82c686b-isa 05:0 @0x85 <- 0x3
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x5a, size: 1
        pci_cfg_write vt82c686b-isa 05:0 @0x5a <- 0x7
        bonito_spciconf_small_access PCI config address is smaller then 32-bit, addr: 0x85, size: 1
        pci_cfg_write vt82c686b-isa 05:0 @0x85 <- 0x1
      
      Also this is what the Linux kernel does since it supports the Bonito
      north bridge:
      https://elixir.bootlin.com/linux/v2.6.15/source/arch/mips/pci/ops-bonito64.c#L85
      
      
      
      So it seems safe to assume the datasheet is incomplete or outdated
      regarding the address constraints.
      
      This problem was exposed by commit 911629e6
      ("vt82c686: Fix SMBus IO base and configuration registers").
      
      Reported-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Suggested-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20210624202747.1433023-4-f4bug@amsat.org>
      Tested-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      711ef337
    • Philippe Mathieu-Daudé's avatar
      hw/pci-host/bonito: Trace PCI config accesses smaller than 32-bit · 300491f9
      Philippe Mathieu-Daudé authored
      
      Per the datasheet section "5.7.5. Accessing PCI configuration space"
      the address must be 32-bit aligned. Trace eventual accesses not
      aligned to 32-bit.
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20210624202747.1433023-3-f4bug@amsat.org>
      300491f9
  16. Jun 02, 2021
  17. May 13, 2021
  18. May 04, 2021
  19. May 02, 2021
  20. Apr 30, 2021
  21. Mar 06, 2021
  22. Feb 23, 2021
  23. Feb 10, 2021
  24. Feb 09, 2021
  25. Feb 08, 2021
Loading