Add a generic DesignWare APB timer device model, and wire it
up for the K230 machine with num-timers=6 and a 6.25 MHz clock.
Changes since v2:
- Per Bin Meng's review, refactored from K230-specific device
to a generic DesignWare APB Timer model with num-timers property
- K230 board sets num-timers=6 and clock frequency accordingly
Changes since v1:
- Split into 3 patches: model, board integration, tests
- Remove goto pattern from read/write handlers
- Fix include order, add explicit bitops.h include
- Add QOM <private>/<public> markers in struct
- Fix copyright headers
raoyi (3):
hw/timer: add DesignWare APB timer model
hw/riscv: add DesignWare APB timer to K230 board
tests/qtest: add k230 dwapb timer test
MAINTAINERS | 3 +
hw/riscv/Kconfig | 1 +
hw/riscv/k230.c | 32 +++-
hw/timer/Kconfig | 4 +
hw/timer/dw-apb-timer.c | 341 ++++++++++++++++++++++++++++
hw/timer/meson.build | 1 +
hw/timer/trace-events | 8 +
include/hw/riscv/k230.h | 12 ++
include/hw/timer/dw-apb-timer.h | 65 +++++
tests/qtest/k230-dwapb-timer-test.c | 261 +++++++++++++++++++++
tests/qtest/meson.build | 4 +-
11 files changed, 728 insertions(+), 4 deletions(-)
create mode 100644 hw/timer/dw-apb-timer.c
create mode 100644 include/hw/timer/dw-apb-timer.h
create mode 100644 tests/qtest/k230-dwapb-timer-test.c
--
2.53.0