summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-02-12 16:46:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-13 10:20:26 +0100
commitb1fc601eda2b5ed24ebeb15a51573a8fe368610c (patch)
treedec435a4ff6f18cf6f6826755f0da84f612cacaa /arch
parent6530d4bad33dbc23fb48e2673600e50e510de41a (diff)
downloadbarebox-b1fc601eda2b5ed24ebeb15a51573a8fe368610c.tar.gz
barebox-b1fc601eda2b5ed24ebeb15a51573a8fe368610c.tar.xz
ARM: at91: sama5d27-som1: autoping watchdog during barebox runtime
The BootROM arms the watchdog with the maximum timeout of 16 seconds on boot. This is ample time to boot into Linux userspace, so so far we didn't touch the watchdog for the SAMA5D2 in barebox and expected the user to disable the watchdog manually, e.g. via the `wd -x` command or by storing nv.autoboot=abort into the environment. While this works, this is admittedly bad user experience, so let's just enable watchdog polling in barebox instead. That way, we still have watchdog supervision, but don't reset when dropping into the barebox shell. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240212154617.2260448-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/sama5d27-som1/Makefile1
-rw-r--r--arch/arm/boards/sama5d27-som1/board.c4
-rw-r--r--arch/arm/boards/sama5d27-som1/defaultenv-sama5d27-som1/nv/dev.wdog0.autoping1
-rw-r--r--arch/arm/configs/at91_multi_defconfig1
4 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/boards/sama5d27-som1/Makefile b/arch/arm/boards/sama5d27-som1/Makefile
index 5678718188..96cd8f520f 100644
--- a/arch/arm/boards/sama5d27-som1/Makefile
+++ b/arch/arm/boards/sama5d27-som1/Makefile
@@ -2,3 +2,4 @@
lwl-y += lowlevel.o
obj-y += board.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv-sama5d27-som1
diff --git a/arch/arm/boards/sama5d27-som1/board.c b/arch/arm/boards/sama5d27-som1/board.c
index 00c0e92a5d..6fa903bca4 100644
--- a/arch/arm/boards/sama5d27-som1/board.c
+++ b/arch/arm/boards/sama5d27-som1/board.c
@@ -5,6 +5,7 @@
#include <init.h>
#include <asm/memory.h>
#include <bbu.h>
+#include <envfs.h>
#include <bootsource.h>
#include <of.h>
@@ -30,6 +31,9 @@ static int ek_device_init(void)
filetype_arm_barebox);
bbu_register_std_file_update("microSD", flags_usd, "/mnt/mmc1.0/barebox.bin",
filetype_arm_barebox);
+
+ defaultenv_append_directory(defaultenv_sama5d27_som1);
+
return 0;
}
device_initcall(ek_device_init);
diff --git a/arch/arm/boards/sama5d27-som1/defaultenv-sama5d27-som1/nv/dev.wdog0.autoping b/arch/arm/boards/sama5d27-som1/defaultenv-sama5d27-som1/nv/dev.wdog0.autoping
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/arch/arm/boards/sama5d27-som1/defaultenv-sama5d27-som1/nv/dev.wdog0.autoping
@@ -0,0 +1 @@
+1
diff --git a/arch/arm/configs/at91_multi_defconfig b/arch/arm/configs/at91_multi_defconfig
index e24bb36c28..01e4526329 100644
--- a/arch/arm/configs/at91_multi_defconfig
+++ b/arch/arm/configs/at91_multi_defconfig
@@ -132,6 +132,7 @@ CONFIG_KEYBOARD_QT1070=y
CONFIG_KEYBOARD_USB=y
CONFIG_INPUT_SPECIALKEYS=y
CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_POLLER=y
CONFIG_WATCHDOG_AT91SAM9=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED=y