From 8dce58d4412dd6784139613184ce655a88d05222 Mon Sep 17 00:00:00 2001 From: Stefan Sicleru Date: Mon, 13 Jun 2016 15:20:57 +0200 Subject: linux-ls1: fix reset issue Watchdog failed to assert reset signal so the board hanged everytime a reboot command was issued. The watchdog (same controller used for i.MX platforms) has an errata mentioning a software workaround for a hardware issue that has no scheduled fix. Implemented the workaround described in the errata. The workaround is already present in upstream repositories. Signed-off-by: Stefan Sicleru Signed-off-by: Martin Borg --- .../0002-watchdog-fix-errata-err004346.patch | 35 ++++++++++++++++++++++ recipes-kernel/linux/linux-ls1_3.12.bbappend | 1 + 2 files changed, 36 insertions(+) create mode 100644 recipes-kernel/linux/linux-ls1/0002-watchdog-fix-errata-err004346.patch diff --git a/recipes-kernel/linux/linux-ls1/0002-watchdog-fix-errata-err004346.patch b/recipes-kernel/linux/linux-ls1/0002-watchdog-fix-errata-err004346.patch new file mode 100644 index 0000000..a69ef9b --- /dev/null +++ b/recipes-kernel/linux/linux-ls1/0002-watchdog-fix-errata-err004346.patch @@ -0,0 +1,35 @@ +From ff7712de39c333cf888e497a90f88601ef3e228f Mon Sep 17 00:00:00 2001 +From: Stefan Sicleru +Date: Fri, 10 Jun 2016 10:42:28 +0200 +Subject: [PATCH] watchdog: fix errata ERR004346 + +Due to errata ERR004346 (WDOG: SRS bit requires to be written twice), two +additional writes are added to ensure that at least two writes occur within +one period of the 32kHz clock. + +Replace __raw_writew() calls with *_relaxed() calls in order to be +endian-safe. + +Signed-off-by: Stefan Sicleru +--- + arch/arm/mach-imx/system.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c +index 80c177c..6e09ac0 100644 +--- a/arch/arm/mach-imx/system.c ++++ b/arch/arm/mach-imx/system.c +@@ -51,7 +51,10 @@ void mxc_restart(enum reboot_mode mode, const char *cmd) + wcr_enable = (1 << 2); + + /* Assert SRS signal */ +- __raw_writew(wcr_enable, wdog_base); ++ ++ writew_relaxed(wcr_enable, wdog_base); ++ writew_relaxed(wcr_enable, wdog_base); ++ writew_relaxed(wcr_enable, wdog_base); + + /* wait for reset to assert... */ + mdelay(500); +-- +1.9.1 diff --git a/recipes-kernel/linux/linux-ls1_3.12.bbappend b/recipes-kernel/linux/linux-ls1_3.12.bbappend index e8fd2e4..e0c7a91 100644 --- a/recipes-kernel/linux/linux-ls1_3.12.bbappend +++ b/recipes-kernel/linux/linux-ls1_3.12.bbappend @@ -4,6 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://ls1021aiot.dts \ file://0001-fsnotify-fix-oops-in-fsnotify_clear_marks_by_group_f.patch \ + file://0002-watchdog-fix-errata-err004346.patch \ " # fix err: "linux-ls1-3.12-r0 do_deploy: Taskhash mismatch" -- cgit v1.2.3-54-g00ecf