This series adds the BCM2711 RNG200 hardware random number generator
and the dummy thermal sensor to raspi4b, carrying forward two more
patches from Sergey Kambalin's stalled Raspberry Pi 4B series
(patchwork series 829638). Patches 1 and 3 are Kambalin's code with
his authorship and Signed-off-by kept, adapted only for API drift
since 2024; patches 2 and 4 wire the devices into the SoC, and patch
5 extends the existing functional test.
v2: thanks to Peter for the review. Now based directly on current
master -- v1 was written on top of the "working PCIe and GENET" series
and so did not apply to master; it no longer depends on that series.
- Patch 1: use VMSTATE_UINT32_ARRAY(), open-code the one-use
increment_bit_counter_by() helper, stop aligning the format
strings in trace-events, and drop the unneeded <stdbool.h>
include from the header.
- Patch 4: since the PCIe and GENET entries are no longer removed
by an earlier patch in this series, this now only drops the
"brcm,bcm2711-thermal" entry from nodes_to_remove[] rather than
removing the whole mechanism; the commit message is updated to
match. (The "working PCIe and GENET" series will drop the
remaining entries.) Peter's Reviewed-by is kept, as the change is
a strict subset of what he reviewed -- please say if you'd rather
I dropped it.
- Patch 5: fold the RNG200/thermal checks into the existing
test_arm_raspi4_initrd test instead of adding a test that boots
the same kernel again, as suggested.
- Added Peter's Reviewed-by to patches 2, 3 and 4.
- Rebased on current master (7e8d3c7fc4).
This conflicts trivially (three files: raspi4b.c and
bcm2838_peripherals.[ch]) with the "working PCIe and GENET" series
("[PATCH v3 00/16] hw/arm/raspi4b: working PCIe and GENET (real
networking)"), which is posted separately. Whichever lands second, I
will rebase.
Tested: checkpatch.pl reports no errors, the series builds on current
master, tests/functional/aarch64/test_raspi4.py passes, and a
Raspberry Pi OS Bullseye image boots to a login prompt with
"iproc-rng200 fe104000.rng: hwrng registered" in the kernel log.
Marcelo Manzo (3):
hw/arm/bcm2838: enable BCM2838 RNG200
hw/arm/bcm2838: enable BCM2838 thermal sensor
tests/functional/aarch64: add raspi4b RNG200/thermal test
Sergey Kambalin (2):
hw/misc/bcm2838_rng200: add BCM2838 RNG200
hw/misc/bcm2838_thermal: add BCM2838 thermal sensor
hw/arm/bcm2838.c | 4 +
hw/arm/bcm2838_peripherals.c | 28 ++
hw/arm/raspi4b.c | 2 -
hw/misc/bcm2838_rng200.c | 400 ++++++++++++++++++++++++
hw/misc/bcm2838_thermal.c | 98 ++++++
hw/misc/meson.build | 2 +
hw/misc/trace-events | 10 +
include/hw/arm/bcm2838_peripherals.h | 4 +
include/hw/misc/bcm2838_rng200.h | 41 +++
include/hw/misc/bcm2838_thermal.h | 23 ++
tests/functional/aarch64/test_raspi4.py | 7 +
11 files changed, 617 insertions(+), 2 deletions(-)
create mode 100644 hw/misc/bcm2838_rng200.c
create mode 100644 hw/misc/bcm2838_thermal.c
create mode 100644 include/hw/misc/bcm2838_rng200.h
create mode 100644 include/hw/misc/bcm2838_thermal.h
--
2.55.0