[PATCH v3 00/22] hw/arm: Add initial RK3588 and ROCK 5B support

Yifan Wang posted 22 patches 3 days, 6 hours ago
Only 14 patches received!
MAINTAINERS                              |  23 +
docs/system/arm/rock-5b.rst              |  90 ++++
docs/system/target-arm.rst               |   1 +
hw/arm/Kconfig                           |  16 +
hw/arm/meson.build                       |   3 +
hw/arm/rk3588.c                          | 500 +++++++++++++++++++
hw/arm/rock-5b.c                         | 439 +++++++++++++++++
hw/block/m25p80.c                        |  20 +
hw/char/dw8250.c                         |  37 ++
hw/char/serial.c                         |  21 -
hw/misc/meson.build                      |   7 +
hw/misc/rk3588-grf.c                     | 282 +++++++++++
hw/misc/rk3588-pmu.c                     | 394 +++++++++++++++
hw/misc/rk3588-scmci.c                   | 589 +++++++++++++++++++++++
hw/misc/rockchip_cru.c                   | 250 ++++++++++
hw/misc/rockchip_otp.c                   | 146 ++++++
hw/ssi/Kconfig                           |   5 +
hw/ssi/meson.build                       |   1 +
hw/ssi/rockchip_sfc.c                    | 439 +++++++++++++++++
hw/timer/meson.build                     |   1 +
hw/timer/rockchip-hptimer.c              | 115 +++++
include/hw/arm/arm-smc.h                 |  31 ++
include/hw/arm/rk3588.h                  |  65 +++
include/hw/char/serial.h                 |  25 +
include/hw/misc/rk3588-grf.h             |  22 +
include/hw/misc/rk3588-pmu.h             |  18 +
include/hw/misc/rk3588-scmci.h           |  25 +
include/hw/timer/rockchip-hptimer.h      |  20 +
target/arm/helper.c                      |  80 +++
target/arm/internals.h                   |   3 +
target/arm/kvm-consts.h                  |   5 +
target/arm/tcg/psci.c                    |  15 +
tests/functional/aarch64/meson.build     |   2 +
tests/functional/aarch64/test_rock_5b.py | 123 +++++
34 files changed, 3792 insertions(+), 21 deletions(-)
create mode 100644 docs/system/arm/rock-5b.rst
create mode 100644 hw/arm/rk3588.c
create mode 100644 hw/arm/rock-5b.c
create mode 100644 hw/misc/rk3588-grf.c
create mode 100644 hw/misc/rk3588-pmu.c
create mode 100644 hw/misc/rk3588-scmci.c
create mode 100644 hw/misc/rockchip_cru.c
create mode 100644 hw/misc/rockchip_otp.c
create mode 100644 hw/ssi/rockchip_sfc.c
create mode 100644 hw/timer/rockchip-hptimer.c
create mode 100644 include/hw/arm/arm-smc.h
create mode 100644 include/hw/arm/rk3588.h
create mode 100644 include/hw/misc/rk3588-grf.h
create mode 100644 include/hw/misc/rk3588-pmu.h
create mode 100644 include/hw/misc/rk3588-scmci.h
create mode 100644 include/hw/timer/rockchip-hptimer.h
create mode 100755 tests/functional/aarch64/test_rock_5b.py
[PATCH v3 00/22] hw/arm: Add initial RK3588 and ROCK 5B support
Posted by Yifan Wang 3 days, 6 hours ago
Hi,

This series adds initial support for the Rockchip RK3588 SoC and the
Radxa ROCK 5B board. It supports booting Linux through U-Boot SPL,
TF-A BL31 and U-Boot from SPI NOR flash, as well as direct kernel boot.

The implementation includes the eight Cortex-A55/A76 CPUs, GICv3,
architectural timers, SRAM, UARTs, and the Rockchip SPI flash controller.
It also models the CRU, GRF, OTP, HPTIMER and CPU power control needed
by the boot software.

Patches 1-5 extend DW8250 and ARM SMC support and add the XTX XT25F128
flash device. Patches 6-17 add the RK3588 SoC, its devices and the ROCK
5B board. Patches 18-20 add GRF, CPU power control and firmware boot
support. Patches 21-22 add functional tests and documentation.

Both boot paths have been tested with Linux 6.12.4, with U-Boot 2025.01
and TF-A v2.12.0 used for the firmware boot path. The included functional
tests cover booting to a Buildroot shell and reboot on both paths, and
poweroff with direct kernel boot.

Comments and suggestions are welcome.

Thanks,
Yifan

Changes in v3:
- Address UART feedback and correct the "Non-secure" spelling.
- Add BL31 boot support with PMU CPU power control and CRU reset support.
- Add GRF support and initialize firmware RAM information from -m to fix
  U-Boot always reporting 512 MiB.
- Rebase onto upstream master at fbb87b0d358a.

Changes in v2:
- Reuse the common UART LSR/FCR definitions in patch 1, as suggested
  by Kuan-Wei Chiu.
- Rebase onto upstream master at 9751c6235807.

v2:
https://lore.kernel.org/qemu-devel/cover.1795893747.git.w-yf22@mails.tsinghua.edu.cn/
v1:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg1243890.html

Chao Liu (20):
  hw/char/dw8250: implement the UART status register
  hw/char/dw8250: expose the baudbase property
  target/arm: report SMCCC v1.1 support
  target/arm: allow machines to handle SMC calls
  hw/block/m25p80: add the XTX XT25F128 SPI NOR flash
  hw/arm: add the Rockchip RK3588 SoC
  hw/timer: add Rockchip HPTIMER boot control
  hw/arm/rk3588: add the unimplemented device map
  hw/arm/rk3588: add the GICv3 interrupt controller
  hw/arm/rk3588: add the UARTs
  hw/misc: add the RK3588 clock and reset unit
  hw/misc: add the RK3588 OTP controller
  hw/ssi: add the Rockchip SPI flash controller
  hw/misc: add RK3588 SCMI server
  hw/arm/rk3588: wire up the SCMI server
  hw/arm: add Radxa ROCK 5B board
  hw/arm/rock-5b: connect the XTX XT25F128 SPI NOR flash
  hw/arm/rock-5b: add firmware booting
  tests/functional: add ROCK 5B boot tests
  docs/system/arm: document the Radxa ROCK 5B machine

Yifan Wang (2):
  hw/misc: add RK3588 general register files
  hw/misc: add RK3588 CPU power control

 MAINTAINERS                              |  23 +
 docs/system/arm/rock-5b.rst              |  90 ++++
 docs/system/target-arm.rst               |   1 +
 hw/arm/Kconfig                           |  16 +
 hw/arm/meson.build                       |   3 +
 hw/arm/rk3588.c                          | 500 +++++++++++++++++++
 hw/arm/rock-5b.c                         | 439 +++++++++++++++++
 hw/block/m25p80.c                        |  20 +
 hw/char/dw8250.c                         |  37 ++
 hw/char/serial.c                         |  21 -
 hw/misc/meson.build                      |   7 +
 hw/misc/rk3588-grf.c                     | 282 +++++++++++
 hw/misc/rk3588-pmu.c                     | 394 +++++++++++++++
 hw/misc/rk3588-scmci.c                   | 589 +++++++++++++++++++++++
 hw/misc/rockchip_cru.c                   | 250 ++++++++++
 hw/misc/rockchip_otp.c                   | 146 ++++++
 hw/ssi/Kconfig                           |   5 +
 hw/ssi/meson.build                       |   1 +
 hw/ssi/rockchip_sfc.c                    | 439 +++++++++++++++++
 hw/timer/meson.build                     |   1 +
 hw/timer/rockchip-hptimer.c              | 115 +++++
 include/hw/arm/arm-smc.h                 |  31 ++
 include/hw/arm/rk3588.h                  |  65 +++
 include/hw/char/serial.h                 |  25 +
 include/hw/misc/rk3588-grf.h             |  22 +
 include/hw/misc/rk3588-pmu.h             |  18 +
 include/hw/misc/rk3588-scmci.h           |  25 +
 include/hw/timer/rockchip-hptimer.h      |  20 +
 target/arm/helper.c                      |  80 +++
 target/arm/internals.h                   |   3 +
 target/arm/kvm-consts.h                  |   5 +
 target/arm/tcg/psci.c                    |  15 +
 tests/functional/aarch64/meson.build     |   2 +
 tests/functional/aarch64/test_rock_5b.py | 123 +++++
 34 files changed, 3792 insertions(+), 21 deletions(-)
 create mode 100644 docs/system/arm/rock-5b.rst
 create mode 100644 hw/arm/rk3588.c
 create mode 100644 hw/arm/rock-5b.c
 create mode 100644 hw/misc/rk3588-grf.c
 create mode 100644 hw/misc/rk3588-pmu.c
 create mode 100644 hw/misc/rk3588-scmci.c
 create mode 100644 hw/misc/rockchip_cru.c
 create mode 100644 hw/misc/rockchip_otp.c
 create mode 100644 hw/ssi/rockchip_sfc.c
 create mode 100644 hw/timer/rockchip-hptimer.c
 create mode 100644 include/hw/arm/arm-smc.h
 create mode 100644 include/hw/arm/rk3588.h
 create mode 100644 include/hw/misc/rk3588-grf.h
 create mode 100644 include/hw/misc/rk3588-pmu.h
 create mode 100644 include/hw/misc/rk3588-scmci.h
 create mode 100644 include/hw/timer/rockchip-hptimer.h
 create mode 100755 tests/functional/aarch64/test_rock_5b.py


base-commit: fbb87b0d358a3e8ab11d59bcdf80ac34c97f6e3e
-- 
2.53.0