Skip to content

Commit cd28d6f

Browse files
committed
Support watchdog for Starfive JH7100 SOC
Signed-off-by: Samin Guo <samin.guo@starfivetech.com> Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
1 parent 5ac69e4 commit cd28d6f

5 files changed

Lines changed: 805 additions & 0 deletions

File tree

arch/riscv/boot/dts/starfive/jh7100.dtsi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,20 @@
566566
status = "disabled";
567567
};
568568

569+
wdt: wdt@12480000 {
570+
compatible = "starfive,si5-wdt";
571+
reg = <0x0 0x12480000 0x0 0x10000>;
572+
interrupts = <80>;
573+
clocks = <&clkgen JH7100_CLK_WDT_CORE>,
574+
<&clkgen JH7100_CLK_WDTIMER_APB>;
575+
clock-names = "wdt_coreclk", "wdtimer_apb";
576+
clock-frequency = <50000000>;
577+
resets = <&rstgen JH7100_RSTN_WDTIMER_APB>,
578+
<&rstgen JH7100_RSTN_WDT>;
579+
reset-names = "wdtimer_apb", "wdt";
580+
status = "okay";
581+
};
582+
569583
ptc: pwm@12490000 {
570584
compatible = "starfive,pwm0";
571585
reg = <0x0 0x12490000 0x0 0x10000>;

arch/riscv/configs/visionfive_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ CONFIG_THERMAL_NETLINK=y
132132
CONFIG_THERMAL_STATISTICS=y
133133
CONFIG_THERMAL_WRITABLE_TRIPS=y
134134
CONFIG_CPU_THERMAL=y
135+
CONFIG_WATCHDOG=y
136+
CONFIG_STARFIVE_WATCHDOG=y
135137
CONFIG_MFD_TPS65086=y
136138
CONFIG_DRM=y
137139
CONFIG_DRM_I2C_NXP_TDA998X=y

drivers/watchdog/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,6 +2008,15 @@ config UML_WATCHDOG
20082008
tristate "UML watchdog"
20092009
depends on UML || COMPILE_TEST
20102010

2011+
# RISCV Architecture
2012+
2013+
config STARFIVE_WATCHDOG
2014+
tristate "StarFive Watchdog support"
2015+
depends on RISCV
2016+
select WATCHDOG_CORE
2017+
help
2018+
Say Y here to support the starfive Si5 watchdog.
2019+
20112020
#
20122021
# ISA-based Watchdog Cards
20132022
#

drivers/watchdog/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ obj-$(CONFIG_WATCHDOG_SUN4V) += sun4v_wdt.o
203203
# Xen
204204
obj-$(CONFIG_XEN_WDT) += xen_wdt.o
205205

206+
# RISCV Architecture
207+
obj-$(CONFIG_STARFIVE_WATCHDOG) += starfive-wdt.o
208+
206209
# Architecture Independent
207210
obj-$(CONFIG_BD957XMUF_WATCHDOG) += bd9576_wdt.o
208211
obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o

0 commit comments

Comments
 (0)