Skip to content

hw/arm/raspi4b: RNG200 and thermal sensor

Marcelo Manzo qemu-arm qemu-devel 2 versions – Applied

Status from this message: Applied to target-arm.next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyApplied
  2. v15 patches 7 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5hw/misc/bcm2838_rng200: add BCM2838 RNG200hw/misc/bcm2838_rng200.c hw/misc/meson.build hw/misc/trace-events +1 more+452 -00 replies
2/5hw/arm/bcm2838: enable BCM2838 RNG200hw/arm/bcm2838.c hw/arm/bcm2838_peripherals.c hw/arm/raspi4b.c +1 more+23 -10 replies
3/5hw/misc/bcm2838_thermal: add BCM2838 thermal sensorhw/misc/bcm2838_thermal.c hw/misc/meson.build include/hw/misc/bcm2838_thermal.h+122 -00 replies
4/5hw/arm/bcm2838: enable BCM2838 thermal sensorhw/arm/bcm2838_peripherals.c hw/arm/raspi4b.c include/hw/arm/bcm2838_peripherals.h+13 -10 replies
5/5tests/functional/aarch64: add raspi4b RNG200/thermal testtests/functional/aarch64/test_raspi4.py+7 -00 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchPeter Maydell
1/5
2/5R-b
3/5R-b
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] hw/arm/raspi4b: RNG200 and thermal sensor

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
Signature · 1 line
2.55.0