On Thu, 15 Oct 2026 at 19:11, Marcelo Manzo <[email protected]> wrote:
>
> Add a bare-bones BCM2838 GENET (Gigabit Ethernet) sysbus device:
> MMIO region registration, an out-of-range read/write handler that
> just logs, and a reset callback. No register-level behavior yet;
> that comes in the following patches.
>
> Adapted from patch 19/41 of Sergey Kambalin's Raspberry Pi 4B
> series (patchwork series 829638) against current QEMU master. The
> reset callback and class_init() use the current Resettable-phases
> API (ResettableClass / resettable_class_set_parent_phases()) rather
> than the plain DeviceClass::reset hook the original patch used, and
> headers moved under hw/core/, both API changes since the series was
> originally posted.
>
> Signed-off-by: Marcelo Manzo <[email protected]>
> --
> +static const MemoryRegionOps bcm2838_genet_ops = {
> + .read = bcm2838_genet_read,
> + .write = bcm2838_genet_write,
> + .endianness = DEVICE_LITTLE_ENDIAN,
> + .impl = {.max_access_size = 4},
> + .valid = {.min_access_size = 4},
We should set both min and max to 4 on impl and valid here;
I think it's clearer and less prone to accidental misreading.
-- PMM