Skip to content

riscv: Clean up timer drivers

Sean Anderson u-boot 6 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest9 patches 0 repliesNew
  2. v59 patches 0 repliesSuperseded
  3. v48 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v37 patches0 repliesSuperseded
v27 patches0 repliesSuperseded
v16 patches0 repliesSuperseded

Changes in v6 from the cover letter

- Don't compile timer_timebase_fallback if CONFIG_CPU is disabled. This config is only disabled on nds32; perhaps it can be enabled in the future? In addition, SPL_CPU_SUPPORT should probably be renamed to SPL_CPU

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9riscv: Rework riscv timer driver to only support S-modearch/riscv/Kconfig arch/riscv/cpu/ax25/Kconfig arch/riscv/cpu/fu540/Kconfig +5 more+25 -710 replies
2/9timer: Add helper for drivers using timebase fallbackdrivers/timer/timer-uclass.c include/timer.h+46 -00 replies
3/9timer: Add a test for timer_timebase_fallbackarch/sandbox/dts/test.dts arch/sandbox/include/asm/cpu.h drivers/cpu/cpu_sandbox.c +2 more+80 -100 replies
4/9riscv: Rework Andes PLMT as a UCLASS_TIMER driverarch/riscv/Kconfig arch/riscv/include/asm/global_data.h arch/riscv/include/asm/syscon.h +1 more+23 -320 replies
5/9riscv: Clean up initialization in Andes PLICarch/riscv/lib/andes_plic.c+25 -330 replies
6/9riscv: Rework Sifive CLINT as UCLASS_TIMER driverarch/riscv/Kconfig arch/riscv/lib/sifive_clint.c+36 -340 replies
7/9riscv: clk: Add CLINT clock to kendryte clock driverdrivers/clk/kendryte/clk.c include/dt-bindings/clock/k210-sysctl.h+5 -00 replies
8/9riscv: Update Kendryte device tree for new CLINT driverarch/riscv/dts/k210.dtsi+4 -30 replies
9/9riscv: Update SiFive device tree for new CLINT driverarch/riscv/dts/fu540-c000-u-boot.dtsi arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi+10 -20 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchBin MengRick ChenSimon GlassPragnesh Patel
1/9R-b R-b
2/9R-b R-b R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9
8/9R-b
9/9R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/9] riscv: Clean up timer drivers

This series cleans up the timer drivers in RISC-V and converts them to DM.

This series needs to be tested! I have only tested it on QEMU and the K210. Notably, this means that the HiFive and anything Andes is completely untested.

This series depends on [1]. Without that patch, build will fail for sifive targets.

[1] http://patchwork.ozlabs.org/project/uboot/patch/1600157107-57175-2-git-send-email-bmeng.cn at gmail.com/

Changes in v6:
- Don't compile timer_timebase_fallback if CONFIG_CPU is disabled. This config is only disabled on nds32; perhaps it can be enabled in the future? In addition, SPL_CPU_SUPPORT should probably be renamed to SPL_CPU

Changes in v5:
- Add test for timer_timebase_fallback
- Don't add a dependency on REGMAP for SIFIVE_FU540_DDR. Instead, depend on Bin Meng's patch.
- Remove RISCV_SYSCON_PLMT
- Undo changes to ae350 device trees. They are unnecessary with timer_timebase_fallback.

Changes in v4:
- Both the Andes PMLT and Sifive CLINT now fall back on timebase-frequency, per discussion with Anup Patel
- Introduce helper function for falling back on timebase-frequency
- Modify RISCV_TIMER KConfig
- Now depends on RISCV
- Implied by S-Mode (with or without SPL)
- Rebase
- Remove clock-frequency property from k210 clint binding because we fall back on timebase-frequency

Changes in v3:
- Don't initialize the IPI in spl_invoke_opensbi. Further testing has revealed it to be unnecessary.
- Rebase

Changes in v2:
- Fix SiFive CLINT not getting tick-rate from rtcclk
- Remove RISCV_RDTIME KConfig option
- Split Kendryte binding changes into their own commit

Sean Anderson (9):
riscv: Rework riscv timer driver to only support S-mode
timer: Add helper for drivers using timebase fallback
timer: Add a test for timer_timebase_fallback
riscv: Rework Andes PLMT as a UCLASS_TIMER driver
riscv: Clean up initialization in Andes PLIC
riscv: Rework Sifive CLINT as UCLASS_TIMER driver
riscv: clk: Add CLINT clock to kendryte clock driver
riscv: Update Kendryte device tree for new CLINT driver
riscv: Update SiFive device tree for new CLINT driver

 arch/riscv/Kconfig                            | 16 -----
 arch/riscv/cpu/ax25/Kconfig                   |  2 +-
 arch/riscv/cpu/fu540/Kconfig                  |  2 +-
 arch/riscv/cpu/generic/Kconfig                |  2 +-
 arch/riscv/dts/fu540-c000-u-boot.dtsi         |  8 ++-
 .../dts/hifive-unleashed-a00-u-boot.dtsi      |  4 ++
 arch/riscv/dts/k210.dtsi                      |  7 +-
 arch/riscv/include/asm/global_data.h          |  3 -
 arch/riscv/include/asm/syscon.h               |  4 +-
 arch/riscv/lib/Makefile                       |  1 -
 arch/riscv/lib/andes_plic.c                   | 58 +++++++---------
 arch/riscv/lib/andes_plmt.c                   | 44 ++++++-------
 arch/riscv/lib/rdtime.c                       | 38 -----------
 arch/riscv/lib/sifive_clint.c                 | 66 ++++++++++---------
 arch/sandbox/dts/test.dts                     |  9 ++-
 arch/sandbox/include/asm/cpu.h                | 11 ++++
 drivers/clk/kendryte/clk.c                    |  4 ++
 drivers/cpu/cpu_sandbox.c                     | 39 +++++++++--
 drivers/timer/Kconfig                         |  4 +-
 drivers/timer/riscv_timer.c                   | 39 +++++------
 drivers/timer/sandbox_timer.c                 |  4 +-
 drivers/timer/timer-uclass.c                  | 31 +++++++++
 include/dt-bindings/clock/k210-sysctl.h       |  1 +
 include/timer.h                               | 15 +++++
 test/dm/timer.c                               | 27 +++++++-
 25 files changed, 254 insertions(+), 185 deletions(-)
 delete mode 100644 arch/riscv/lib/rdtime.c
 create mode 100644 arch/sandbox/include/asm/cpu.h
Signature · 1 line
2.28.0