[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/49] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 20/49] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented |
Date: |
Sun, 12 Jan 2025 23:16:56 +0100 |
In order to track access to reserved I/O space, use yet
another UnimplementedDevice covering the whole device
memory range. Mapped with lower priority (-1).
The memory flat view becomes:
(qemu) info mtree -f
FlatView #0
Root memory region: system
0000000081000000-00000000810007e3 (prio 0, ram): ethlite.tx[0]buf
00000000810007e4-00000000810007f3 (prio 0, i/o): ethlite.mdio
00000000810007f4-00000000810007ff (prio 0, i/o): ethlite.tx[0]io
0000000081000800-0000000081000fe3 (prio 0, ram): ethlite.tx[1]buf
0000000081000fe4-0000000081000ff3 (prio -1, i/o): ethlite.reserved
@0000000000000fe4
0000000081000ff4-0000000081000fff (prio 0, i/o): ethlite.tx[1]io
0000000081001000-00000000810017e3 (prio 0, ram): ethlite.rx[0]buf
00000000810017e4-00000000810017fb (prio -1, i/o): ethlite.reserved
@00000000000017e4
00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io
0000000081001800-0000000081001fe3 (prio 0, ram): ethlite.rx[1]buf
0000000081001fe4-0000000081001ffb (prio -1, i/o): ethlite.reserved
@0000000000001fe4
0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20241114210010.34502-20-philmd@linaro.org>
---
hw/net/xilinx_ethlite.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c
index a7f6d1b368c..14bf2b2e17a 100644
--- a/hw/net/xilinx_ethlite.c
+++ b/hw/net/xilinx_ethlite.c
@@ -94,6 +94,7 @@ struct XlnxXpsEthLite
uint32_t c_rx_pingpong;
unsigned int port_index; /* dual port RAM index */
+ UnimplementedDeviceState rsvd;
UnimplementedDeviceState mdio;
XlnxXpsEthLitePort port[2];
};
@@ -303,6 +304,16 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error
**errp)
memory_region_init(&s->container, OBJECT(dev),
"xlnx.xps-ethernetlite", 0x2000);
+ object_initialize_child(OBJECT(dev), "ethlite.reserved", &s->rsvd,
+ TYPE_UNIMPLEMENTED_DEVICE);
+ qdev_prop_set_string(DEVICE(&s->rsvd), "name", "ethlite.reserved");
+ qdev_prop_set_uint64(DEVICE(&s->rsvd), "size",
+ memory_region_size(&s->container));
+ sysbus_realize(SYS_BUS_DEVICE(&s->rsvd), &error_fatal);
+ memory_region_add_subregion_overlap(&s->container, 0,
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->rsvd), 0),
+ -1);
+
object_initialize_child(OBJECT(dev), "ethlite.mdio", &s->mdio,
TYPE_UNIMPLEMENTED_DEVICE);
qdev_prop_set_string(DEVICE(&s->mdio), "name", "ethlite.mdio");
--
2.47.1
- [PULL 10/49] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper, (continued)
- [PULL 10/49] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 11/49] hw/net/xilinx_ethlite: Access TX_GIE register for each port, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 12/49] hw/net/xilinx_ethlite: Access TX_LEN register for each port, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 13/49] hw/net/xilinx_ethlite: Access TX_CTRL register for each port, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 14/49] hw/net/xilinx_ethlite: Map RX_CTRL as MMIO, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 15/49] hw/net/xilinx_ethlite: Map TX_LEN as MMIO, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 16/49] hw/net/xilinx_ethlite: Map TX_GIE as MMIO, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 17/49] hw/net/xilinx_ethlite: Map TX_CTRL as MMIO, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 18/49] hw/net/xilinx_ethlite: Map the RAM buffer as RAM memory region, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 19/49] hw/net/xilinx_ethlite: Rename 'mmio' MR as 'container', Philippe Mathieu-Daudé, 2025/01/12
- [PULL 20/49] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented,
Philippe Mathieu-Daudé <=
- [PULL 21/49] docs/nitro-enclave: Clarify Enclave and Firecracker relationship, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 26/49] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 22/49] hw/misc/vmcoreinfo: Rename VMCOREINFO_DEVICE -> TYPE_VMCOREINFO, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 23/49] hw/misc/vmcoreinfo: Convert to three-phase reset interface, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 24/49] hw/pci: Rename has_power to enabled, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 25/49] hw/ufs: Adjust value to match CPU's endian format, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 27/49] hw/sd/sdhci: Factor sdhci_sdma_transfer() out, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 28/49] hw/char/stm32f2xx_usart: replace print with trace, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 29/49] hw/timer/imx_gpt: Remove unused define, Philippe Mathieu-Daudé, 2025/01/12
- [PULL 31/49] hw/misc/imx6_src: Convert DPRINTF() to trace events, Philippe Mathieu-Daudé, 2025/01/12