[PATCH v2 0/4] Kendryte K230 CMU register model

Simon Law posted 4 patches 1 month, 1 week ago
Failed in applying to current master (apply log)
MAINTAINERS                 |   3 +
docs/system/riscv/k230.rst  |  22 ++
hw/misc/Kconfig             |   3 +
hw/misc/k230_cmu.c          | 903 ++++++++++++++++++++++++++++++++++++++++++++
hw/misc/meson.build         |   1 +
hw/misc/trace-events        |   9 +
hw/riscv/Kconfig            |   1 +
hw/riscv/k230.c             |  14 +-
include/hw/misc/k230_cmu.h  |  58 +++
include/hw/riscv/k230.h     |   2 +
tests/qtest/k230-cmu-test.c | 312 +++++++++++++++
tests/qtest/meson.build     |   3 +-
12 files changed, 1325 insertions(+), 6 deletions(-)
[PATCH v2 0/4] Kendryte K230 CMU register model
Posted by Simon Law 1 month, 1 week ago
The Kendryte K230 machine currently lacks the Clock Management Unit (CMU)
register interface required by the K230 SDK U-Boot and the Linux K230 clock
driver. As a result, software probing the PLL and sysclk providers cannot
observe the expected reset values or register update semantics.

This series adds a minimal, deterministic K230 CMU model.

The model covers:

- four PLL register blocks at 0x91102000..0x9110203f;
- the defined sysclk registers in the 0x91100000 window;
- the software-visible SPI2AXI_CLK_DIV register at sysclk offset 0x108;
- reset values and writable/reserved/read-only masks;
- PLL control write-enable semantics;
- write-one-to-trigger update behavior;
- deterministic PLL lock and initialization status;
- VMState for stable PLL and sysclk register state;
- qtest coverage for reset, masks, write-enable, W1T, status, sysclk
updates, unknown offsets, and system reset;
- K230 machine wiring and user-facing documentation.

---
Changes in v2:
- Drop the extra K230 Machines maintainer entry (Chao Liu).
- Consume descriptor w1t_mask on MMIO writes so W1T strobes self-clear
  and are never retained.
- Align wrapped questions fix (Chao Liu).
- Link to v1: https://lore.kernel.org/qemu-devel/20260809-feat-k230-cmu-v1-0-8792982c446c@gmail.com

To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Chao Liu <chao.liu@processmission.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alistair Francis <alistair.francis@wdc.com>
Cc: Weiwei Li <liwei1518@gmail.com>
Cc: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
Cc: qemu-riscv@nongnu.org
Cc: Fabiano Rosas <farosas@suse.de>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

---
Simon Law (4):
      hw/misc: model K230 CMU registers
      hw/riscv: connect the K230 CMU
      tests/qtest: add K230 CMU coverage
      docs/system/riscv: document K230 CMU support

 MAINTAINERS                 |   3 +
 docs/system/riscv/k230.rst  |  22 ++
 hw/misc/Kconfig             |   3 +
 hw/misc/k230_cmu.c          | 903 ++++++++++++++++++++++++++++++++++++++++++++
 hw/misc/meson.build         |   1 +
 hw/misc/trace-events        |   9 +
 hw/riscv/Kconfig            |   1 +
 hw/riscv/k230.c             |  14 +-
 include/hw/misc/k230_cmu.h  |  58 +++
 include/hw/riscv/k230.h     |   2 +
 tests/qtest/k230-cmu-test.c | 312 +++++++++++++++
 tests/qtest/meson.build     |   3 +-
 12 files changed, 1325 insertions(+), 6 deletions(-)
---
base-commit: f893c46c3931b3684d235d221bf8b7844ddbf1d7
change-id: 20260809-feat-k230-cmu-9b62e6dd23f3

Best regards,
--  
Simon Law <0860734llx@gmail.com>