xemu/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 hw/arm: Correctly disable FPU/DSP for some ARMSSE-based boards 2019-06-17 15:12:25 +01:00
armv7m.h hw/arm/armv7m: Forward "vfp" and "dsp" properties to CPU 2019-06-17 15:12:25 +01:00
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 hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine 2019-11-11 13:44:16 +00:00
digic.h qemu-common: push cpu.h inclusion out of qemu-common.h 2016-05-19 16:42:29 +02:00
exynos4210.h hw/arm/exynos4210: Fix DMA initialization 2020-01-23 16:34:15 +00:00
fdt.h hw/arm/sysbus-fdt: enable vfio-calxeda-xgmac dynamic instantiation 2015-06-19 14:17:44 +01:00
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 qom: make interface types abstract 2018-12-11 15:45:22 -02:00
msf2-soc.h msf2: Add EMAC block to SmartFusion2 SoC 2020-04-30 11:52:28 +01:00
nrf51_soc.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00
nrf51.h hw/arm/nrf51: Add NRF51_PERIPHERAL_SIZE definition 2020-05-11 11:05:11 +01:00
omap.h omap-gpio: remove PROP_PTR 2020-01-07 17:24:29 +04:00
primecell.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
pxa.h hw/pcmcia: Remove PCMCIACardState from "qemu/typedefs.h" 2019-01-22 05:14:32 +01:00
raspi_platform.h hw/arm/bcm2835_peripherals: Use the thermal sensor block 2019-10-25 13:09:27 +01:00
sharpsl.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
smmu-common.h misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
smmuv3.h hw/arm/smmuv3: Cache/invalidate config data 2018-06-26 17:50:42 +01:00
soc_dma.h Include exec/memory.h slightly less 2019-08-16 13:31:52 +02:00
stm32f205_soc.h arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly 2017-09-19 09:09:32 -03:00
stm32f405_soc.h hw/arm: Add the STM32F4xx SoC 2020-01-17 14:09:29 +00:00
sysbus-fdt.h arm/boot: split load_dtb() from arm_load_kernel() 2018-05-10 18:10:56 +01:00
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 hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:28:01 +02:00