Four fixes for BCM2835 peripheral models that the raspi3b and raspi4b
machines use, each with a qtest that fails without the fix:
- bcm2835_i2c: writing 1 to DONE in S did not lower the interrupt.
- bcm2835_spi: a reset left the interrupt line raised.
- bcm2835_systmr: a reset left raised interrupts raised, and a compare
set before the reset still fired after it.
- bcm2835_cprman: a PLL channel divider of 0 divided by 255, not 256.
Patch 1 adds the BCM283x qtests to the Raspberry Pi section of
MAINTAINERS: the three that exist have no entry, and patches 3 to 5
add three more.
The fixes are independent bug fixes and apply to master.
I found these bugs while running Raspberry Pi OS images on a model of
the Compute Module 4: https://github.com/LorandMarton/boardtwin. Its
QEMU changes are on the boardtwin-develop branch of
https://github.com/LorandMarton/qemu. I intend to send the board model
(raspicm4) after the 11.2 release.
Checked: each patch builds and passes its qtests; each new test fails
with only its fix reverted; the aarch64 qtests pass (35, 3 skipped:
the slow cdrom test and the two swtpm tests).
Lorand Marton (5):
MAINTAINERS: list the BCM283x qtests under Raspberry Pi
hw/i2c/bcm2835_i2c: update the interrupt when the status is cleared
hw/ssi/bcm2835_spi: lower the interrupt on reset
hw/timer/bcm2835_systmr: cancel the compares and lower the IRQs on
reset
hw/misc/bcm2835_cprman: a PLL channel divider of 0 divides by 256
MAINTAINERS | 1 +
hw/i2c/bcm2835_i2c.c | 1 +
hw/misc/bcm2835_cprman.c | 6 ++--
hw/ssi/bcm2835_spi.c | 2 ++
hw/timer/bcm2835_systmr.c | 4 +++
tests/qtest/bcm2835-cprman-test.c | 49 ++++++++++++++++++++++++++++
tests/qtest/bcm2835-i2c-test.c | 24 ++++++++++++++
tests/qtest/bcm2835-spi-test.c | 42 ++++++++++++++++++++++++
tests/qtest/bcm2835-systmr-test.c | 54 +++++++++++++++++++++++++++++++
tests/qtest/meson.build | 4 ++-
10 files changed, 183 insertions(+), 4 deletions(-)
create mode 100644 tests/qtest/bcm2835-cprman-test.c
create mode 100644 tests/qtest/bcm2835-spi-test.c
create mode 100644 tests/qtest/bcm2835-systmr-test.c
base-commit: 56afd82bd4db9688f1c1c9d0e2ea163b8cde3283
--
2.56.0