qemu-e2k/include/hw/arm
Cédric Le Goater d3bad7e7c4 arm/aspeed: Rework NIC attachment
The number of MACs supported by an Aspeed SoC is defined by "macs_num"
under the SoC model, that is two for the AST2400 and AST2500 and four
for the AST2600. The model initializes the maximum number of supported
MACs but the number of realized devices is capped by the number of
network device back-ends defined on the command line. This can leave
unrealized devices hanging around in the QOM composition tree.

To get virtual hardware that matches the physical hardware, you have
to pass exactly as many -nic options as there are MACs, and some of
them must be -nic none:

* Machines ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc,
  swift-bmc, and witherspoon-bmc: two -nic, and the second one must be
  -nic none.

* Machine ast2600-evb: four -nic, the first one must be -nic none.

* Machine tacoma-bmc: four nic, the first two and the last one must be
  -nic none.

Modify the machine initialization to define which MACs are attached to
a network device back-end using a bit-field property "macs-mask" and
let the SoC realize all network devices.

The default setting of "macs-mask" is "use MAC0" only, which works for
all our AST2400 and AST2500 machines. The AST2600 machines have
different configurations. The AST2600 EVB machine activates MAC1, MAC2
and MAC3 and the Tacoma BMC machine activates MAC2.

Incompatible CLI change: -nic options now apply to *active* MACs:
MAC1, MAC2, MAC3 for ast2600-evb, MAC2 for tacoma-bmc, and MAC0 for
all the others.

The machines now always get all MACs as they should. Visible in "info
qom-tree", here's the change for tacoma-bmc:

     /machine (tacoma-bmc-machine)
       /peripheral (container)
       /peripheral-anon (container)
       /soc (ast2600-a1)
         [...]
         /ftgmac100[0] (ftgmac100)
           /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[1] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[2] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         /ftgmac100[3] (ftgmac100)
    +      /ftgmac100[0] (qemu:memory-region)
         [...]
         /mii[0] (aspeed-mmi)
           /aspeed-mmi[0] (qemu:memory-region)
         /mii[1] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)
         /mii[2] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)
         /mii[3] (aspeed-mmi)
    +      /aspeed-mmi[0] (qemu:memory-region)

Also visible in "info qtree"; here's the change for tacoma-bmc:

       dev: ftgmac100, id ""
         gpio-out "sysbus-irq" 1
         aspeed = true
    -    mac = "52:54:00:12:34:56"
    -    netdev = "hub0port0"
    +    mac = "52:54:00:12:34:57"
    +    netdev = ""
         mmio 000000001e660000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:58"
         netdev = ""
    +    mmio 000000001e680000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    -    netdev = ""
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:56"
    +    netdev = "hub0port0"
    +    mmio 000000001e670000/0000000000002000
       dev: ftgmac100, id ""
    -    aspeed = false
    -    mac = "00:00:00:00:00:00"
    +    gpio-out "sysbus-irq" 1
    +    aspeed = true
    +    mac = "52:54:00:12:34:59"
         netdev = ""
    +    mmio 000000001e690000/0000000000002000
       [...]
       dev: aspeed-mmi, id ""
         mmio 000000001e650000/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650008/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650010/0000000000000008
       dev: aspeed-mmi, id ""
    +    mmio 000000001e650018/0000000000000008

Inactive MACs will have no peer and QEMU may warn the user with :

    qemu-system-arm: warning: nic ftgmac100.0 has no peer
    qemu-system-arm: warning: nic ftgmac100.1 has no peer
    qemu-system-arm: warning: nic ftgmac100.3 has no peer

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
[Commit message expanded]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-6-armbru@redhat.com>
2020-06-15 21:36:09 +02:00
..
allwinner-a10.h hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
allwinner-h3.h hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
armsse.h
armv7m.h
aspeed_soc.h arm/aspeed: Compute the number of CPUs from the SoC definition 2020-06-15 21:36:09 +02:00
aspeed.h arm/aspeed: Rework NIC attachment 2020-06-15 21:36:09 +02:00
bcm2835_peripherals.h wire in the dwc-hsotg (dwc2) USB host controller emulation 2020-06-05 17:23:09 +01:00
bcm2836.h hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
boot.h
digic.h
exynos4210.h
fdt.h
fsl-imx6.h hw: Move i.MX watchdog driver to hw/watchdog 2020-05-21 20:00:18 +01:00
fsl-imx6ul.h hw: Move i.MX watchdog driver to hw/watchdog 2020-05-21 20:00:18 +01:00
fsl-imx7.h hw/arm/fsl-imx7: Connect watchdog interrupts 2020-05-21 22:05:27 +01:00
fsl-imx25.h hw/arm/fsl-imx25: Wire up watchdog 2020-05-21 22:05:27 +01:00
fsl-imx31.h hw/arm/fsl-imx31: Wire up watchdog 2020-05-21 22:05:27 +01:00
linux-boot-if.h
msf2-soc.h msf2: Add EMAC block to SmartFusion2 SoC 2020-04-30 11:52:28 +01:00
nrf51_soc.h
nrf51.h hw/arm/nrf51: Add NRF51_PERIPHERAL_SIZE definition 2020-05-11 11:05:11 +01:00
omap.h
primecell.h
pxa.h
raspi_platform.h
sharpsl.h
smmu-common.h misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
smmuv3.h
soc_dma.h
stm32f205_soc.h
stm32f405_soc.h
sysbus-fdt.h
virt.h hw/arm/virt: Introduce a RAS machine option 2020-05-14 15:03:09 +01:00
xlnx-versal.h hw/arm: versal: Add support for the RTC 2020-05-04 11:11:28 +01:00
xlnx-zynqmp.h