]> git.dujemihanovic.xyz Git - u-boot.git/commit
riscv: Rework Sifive CLINT as UCLASS_TIMER driver
authorSean Anderson <seanga2@gmail.com>
Mon, 28 Sep 2020 14:52:26 +0000 (10:52 -0400)
committerAndes <uboot@andestech.com>
Wed, 30 Sep 2020 00:54:46 +0000 (08:54 +0800)
commite5ca9a752399c2701cb71527d198bfa78268580d
tree2e792a2bdf8bc6a50fc0ad4cb5b5f55f7ead0783
parent15943bb558d2fef6ae6d2713e252db17754d207d
riscv: Rework Sifive CLINT as UCLASS_TIMER driver

This converts the clint driver from the riscv-specific interface to be a
DM-based UCLASS_TIMER driver. In addition, the SiFive DDR driver previously
implicitly depended on the CLINT to select REGMAP.

Unlike Andes's PLMT/PLIC (which AFAIK never have anything pass it a dtb),
the SiFive CLINT is part of the device tree passed in by qemu. This device
tree doesn't have a clocks or clock-frequency property on clint, so we need
to fall back on the timebase-frequency property. Perhaps in the future we
can get a clock-frequency property added to the qemu dtb.

Unlike with the Andes PLMT, the Sifive CLINT is also an IPI controller.
RISCV_SYSCON_CLINT is retained for this purpose.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com>
arch/riscv/Kconfig
arch/riscv/lib/sifive_clint.c