From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] ARM: imx6: gw54xx: fixup watchdog nodes on pre rev E boards
Date: Mon, 29 May 2017 22:02:42 +0200 [thread overview]
Message-ID: <20170529200242.17934-2-dev@lynxeye.de> (raw)
In-Reply-To: <20170529200242.17934-1-dev@lynxeye.de>
Older boards before revision E don't have the external watchdog signal
wired up to the PMIC, so they must use watchdog 1, which is able to
reset the SoC internally.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/boards/gateworks-ventana/board.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm/boards/gateworks-ventana/board.c b/arch/arm/boards/gateworks-ventana/board.c
index 82dba7c..3ff142e 100644
--- a/arch/arm/boards/gateworks-ventana/board.c
+++ b/arch/arm/boards/gateworks-ventana/board.c
@@ -24,6 +24,19 @@
#include "gsc.h"
+static int gw54xx_wdog_of_fixup(struct device_node *root, void *context)
+{
+ struct device_node *np;
+
+ /* switch to the watchdog with internal reset capabilities */
+ np = of_find_node_by_name(root, "wdog@020c0000");
+ of_device_disable(np);
+ np = of_find_node_by_name(root, "wdog@020bc000");
+ of_device_enable(np);
+
+ return 0;
+}
+
static int gw54xx_devices_init(void)
{
struct i2c_client client;
@@ -60,6 +73,10 @@ static int gw54xx_devices_init(void)
of_eth_register_ethaddr(dnode, mac);
}
+ /* boards before rev E don't have the external watchdog signal */
+ if (gsc_get_rev(&client) < 'E')
+ of_register_fixup(gw54xx_wdog_of_fixup, NULL);
+
imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
barebox_set_hostname("gw54xx");
--
2.9.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-05-29 20:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 20:02 [PATCH 1/2] ARM: imx6: gw54xx: add function to retrieve board revision from GSC Lucas Stach
2017-05-29 20:02 ` Lucas Stach [this message]
2017-06-01 6:21 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170529200242.17934-2-dev@lynxeye.de \
--to=dev@lynxeye.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox