alexcaoys / notes-superbird

18 stars 2 forks source link

Watchdog not enabled #8

Open ericr3r opened 2 weeks ago

ericr3r commented 2 weeks ago

In the current configs, the watchdog isn't enabled. In my fork, I made the following changes which seem to work.

--- linux-6.6.defconfig
+++ linux-6.6.defconfig
@@ -191,6 +191,8 @@ CONFIG_DEVFREQ_THERMAL=y
 CONFIG_THERMAL_EMULATION=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_WATCHDOG_SYSFS=y
+CONFIG_MESON_GXBB_WATCHDOG=y
 CONFIG_MESON_WATCHDOG=y
 CONFIG_BCMA=m
 CONFIG_REGULATOR=y
diff --git linux/0002-add-watchdog-to-superbird-dts.patch linux/0002-add-watchdog-to-superbird-dts.patch
new file mode 100644
index 0000000..047d0d5
--- /dev/null
+++ linux/0002-add-watchdog-to-superbird-dts.patch
@@ -0,0 +1,12 @@
+diff --git arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+index fa33c1eff..ea1873ad1 100644
+--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+@@ -2263,6 +2263,7 @@ watchdog: watchdog@f0d0 {
+                               compatible = "amlogic,meson-gxbb-wdt";
+                               reg = <0x0 0xf0d0 0x0 0x10>;
+                               clocks = <&xtal>;
++                              status = "okay";
+                       };
+ 
+                       spicc0: spi@13000 {

The changes to the overlay could probably be made in another overlay but from what I can tell CONFIG_MESON_GXBB_WATCHDOG is the proper watchdog.

alexcaoys commented 2 weeks ago

Interesting, I am currently on vacation. I will take a look once I am back. You could also submit this change to meson linux mainline git. If it's working properly, this could be a mainline enhancement as well.

ericr3r commented 3 days ago

@alexcaoys Thinking about this more, having the watchdog being disabled by default may be by design. I was able to solve it by creating an overlay and combining it with the existing overlay. The only changes that you may want to pull is in the linux-6.6.defconfig since they would be needed as well.

My overlay for reference:

/dts-v1/;
/plugin/;

/ {
    fragment@0 {
        target-path = "/soc/bus@ffd00000/watchdog@f0d0";
        __overlay__ {
            status = "okay";
        };
    };
};