[PATCH 01/32] hw/mips/malta: Introduce PIIX4_PCI_DEVFN definition

Bernhard Beschow posted 32 patches 3 years, 2 months ago
Maintainers: "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Hervé Poussineau" <hpoussin@reactos.org>, Aurelien Jarno <aurelien@aurel32.net>, Gerd Hoffmann <kraxel@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>
There is a newer version of this series
[PATCH 01/32] hw/mips/malta: Introduce PIIX4_PCI_DEVFN definition
Posted by Bernhard Beschow 3 years, 2 months ago
From: Philippe Mathieu-Daudé <philmd@linaro.org>

The PIIX4 PCI-ISA bridge function is always located at 10:0.
Since we want to re-use its address, add the PIIX4_PCI_DEVFN
definition.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221027204720.33611-2-philmd@linaro.org>
---
 hw/mips/malta.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index c0a2e0ab04..9bffa1b128 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -71,6 +71,8 @@
 
 #define FLASH_SIZE          0x400000
 
+#define PIIX4_PCI_DEVFN     PCI_DEVFN(10, 0)
+
 typedef struct {
     MemoryRegion iomem;
     MemoryRegion iomem_lo; /* 0 - 0x900 */
@@ -1401,7 +1403,7 @@ void mips_malta_init(MachineState *machine)
     empty_slot_init("GT64120", 0, 0x20000000);
 
     /* Southbridge */
-    piix4 = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true,
+    piix4 = pci_create_simple_multifunction(pci_bus, PIIX4_PCI_DEVFN, true,
                                             TYPE_PIIX4_PCI_DEVICE);
     isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix4), "isa.0"));
 
-- 
2.38.1


Re: [PATCH 01/32] hw/mips/malta: Introduce PIIX4_PCI_DEVFN definition
Posted by Igor Mammedov 3 years, 1 month ago
On Sun,  4 Dec 2022 20:05:22 +0100
Bernhard Beschow <shentey@gmail.com> wrote:

> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> The PIIX4 PCI-ISA bridge function is always located at 10:0.
> Since we want to re-use its address, add the PIIX4_PCI_DEVFN
> definition.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20221027204720.33611-2-philmd@linaro.org>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/mips/malta.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/mips/malta.c b/hw/mips/malta.c
> index c0a2e0ab04..9bffa1b128 100644
> --- a/hw/mips/malta.c
> +++ b/hw/mips/malta.c
> @@ -71,6 +71,8 @@
>  
>  #define FLASH_SIZE          0x400000
>  
> +#define PIIX4_PCI_DEVFN     PCI_DEVFN(10, 0)
> +
>  typedef struct {
>      MemoryRegion iomem;
>      MemoryRegion iomem_lo; /* 0 - 0x900 */
> @@ -1401,7 +1403,7 @@ void mips_malta_init(MachineState *machine)
>      empty_slot_init("GT64120", 0, 0x20000000);
>  
>      /* Southbridge */
> -    piix4 = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true,
> +    piix4 = pci_create_simple_multifunction(pci_bus, PIIX4_PCI_DEVFN, true,
>                                              TYPE_PIIX4_PCI_DEVICE);
>      isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix4), "isa.0"));
>