From ef0d30da539828ea466d52c4a9affd8b4f11699a Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Tue, 15 Nov 2011 23:01:12 +0000 Subject: Bring back 'mostly' working omdog support. --- sys/arch/beagle/dev/omap.c | 5 ++++- sys/arch/beagle/dev/omap4.c | 19 +++++++++++++++++-- sys/arch/beagle/dev/omdog.c | 5 ++++- 3 files changed, 25 insertions(+), 4 deletions(-) (limited to 'sys/arch/beagle') diff --git a/sys/arch/beagle/dev/omap.c b/sys/arch/beagle/dev/omap.c index a068e6e1087..aa8307cb29c 100644 --- a/sys/arch/beagle/dev/omap.c +++ b/sys/arch/beagle/dev/omap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omap.c,v 1.2 2011/11/11 10:46:35 matthieu Exp $ */ +/* $OpenBSD: omap.c,v 1.3 2011/11/15 23:01:11 drahn Exp $ */ /* * Copyright (c) 2005,2008 Dale Rahn * @@ -54,6 +54,7 @@ struct board_dev beagleboard_devs[] = { { "intc", 0 }, { "gptimer", 0 }, { "gptimer", 1 }, + { "omdog", 0 }, { "omgpio", 0 }, { "omgpio", 1 }, { "omgpio", 2 }, @@ -70,6 +71,7 @@ struct board_dev overo_devs[] = { { "intc", 0 }, { "gptimer", 0 }, { "gptimer", 1 }, + { "omdog", 0 }, { "omgpio", 0 }, { "omgpio", 1 }, { "omgpio", 2 }, @@ -84,6 +86,7 @@ struct board_dev overo_devs[] = { struct board_dev pandaboard_devs[] = { { "ampintc", 0 }, { "amptimer", 0 }, + { "omdog", 0 }, { "omgpio", 0 }, { "omgpio", 1 }, { "omgpio", 2 }, diff --git a/sys/arch/beagle/dev/omap4.c b/sys/arch/beagle/dev/omap4.c index 77b8534398f..12299a6cc7d 100644 --- a/sys/arch/beagle/dev/omap4.c +++ b/sys/arch/beagle/dev/omap4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omap4.c,v 1.4 2011/11/10 23:43:01 uwe Exp $ */ +/* $OpenBSD: omap4.c,v 1.5 2011/11/15 23:01:11 drahn Exp $ */ /* * Copyright (c) 2011 Uwe Stuehler @@ -16,8 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include +#include +#include #include +#include #include @@ -29,6 +32,9 @@ #define GTIMER_ADDR 0x48240000 #define GTIMER_SIZE 0x300 +#define WD_ADDR 0x4a314000 +#define WD_SIZE 0x80 + #define GPIOx_SIZE 0x1000 #define GPIO1_ADDR 0x4a310000 #define GPIO2_ADDR 0x48055000 @@ -122,6 +128,15 @@ struct omap_dev omap4_devs[] = { .irq = { GPIO6_IRQ } }, + /* + * Watchdog Timer + */ + + { .name = "omdog", + .unit = 0, + .mem = { { WD_ADDR, WD_SIZE } } + }, + /* * UART */ diff --git a/sys/arch/beagle/dev/omdog.c b/sys/arch/beagle/dev/omdog.c index af67391a7e2..4a3e2ef8c03 100644 --- a/sys/arch/beagle/dev/omdog.c +++ b/sys/arch/beagle/dev/omdog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omdog.c,v 1.4 2011/11/10 19:37:01 uwe Exp $ */ +/* $OpenBSD: omdog.c,v 1.5 2011/11/15 23:01:11 drahn Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * @@ -98,6 +98,9 @@ void omdog_reset(void); /* XXX */ void omdog_reset() { + if (omdog_sc == NULL) + return; + bus_space_write_4(omdog_sc->sc_iot, omdog_sc->sc_ioh, WCRR, 0xffffff80); omdog_wpending(WWPS_PEND_ALL); -- cgit v1.2.3