diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-01-31 04:39:06 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-01-31 04:39:06 +0000 |
commit | 3e51587bbb2e72697e5ae443169ac0c2998955a8 (patch) | |
tree | 910cda15e879ad00c753e94532ca6f9e7b547d85 /sys | |
parent | 3b5312424c1680ff5b1225ff5dedf277bdd0c876 (diff) |
Don't use sxitimer on Allwinner sun7i/A20.
sxitimer isn't generating hardclock ticks on Allwinner A20. Fortunately
the Cortex A7 based Allwinner A20 has the ARM Generic Timer (agtimer)
available so use that.
To allow this to work sxirtc gets it's own mapping instead of using a
subregion of sxitimer.
From Patrick Wildt.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/armv7/sunxi/sunxi.c | 5 | ||||
-rw-r--r-- | sys/arch/armv7/sunxi/sunxireg.h | 6 | ||||
-rw-r--r-- | sys/arch/armv7/sunxi/sxirtc.c | 10 |
3 files changed, 9 insertions, 12 deletions
diff --git a/sys/arch/armv7/sunxi/sunxi.c b/sys/arch/armv7/sunxi/sunxi.c index accd475a085..ae0fffa58b0 100644 --- a/sys/arch/armv7/sunxi/sunxi.c +++ b/sys/arch/armv7/sunxi/sunxi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunxi.c,v 1.6 2015/05/20 00:14:56 jsg Exp $ */ +/* $OpenBSD: sunxi.c,v 1.7 2016/01/31 04:39:05 jsg Exp $ */ /* * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com> * @@ -67,9 +67,6 @@ struct board_dev sun4i_devs[] = { struct board_dev sun7i_devs[] = { { "sxipio", 0 }, { "sxiccmu", 0 }, - { "sxitimer", 0 }, - { "sxitimer", 1 }, - { "sxitimer", 2 }, { "sxidog", 0 }, { "sxirtc", 0 }, { "sxiuart", 0 }, diff --git a/sys/arch/armv7/sunxi/sunxireg.h b/sys/arch/armv7/sunxi/sunxireg.h index e1d4f558fd5..323264bdc18 100644 --- a/sys/arch/armv7/sunxi/sunxireg.h +++ b/sys/arch/armv7/sunxi/sunxireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sunxireg.h,v 1.6 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: sunxireg.h,v 1.7 2016/01/31 04:39:05 jsg Exp $ */ /* * Copyright (c) 2013 Artturi Alm * @@ -69,8 +69,8 @@ #define WDOG_SIZE 0x08 #define WDOG_IRQ 24 -#define RTC_ADDR 0x0104 -#define RTC_SIZE 0x08 +#define RTC_ADDR 0x01c20d00 +#define RTC_SIZE 0x20 /* Clock Control Module/Unit */ #define CCMU_ADDR 0x01c20000 diff --git a/sys/arch/armv7/sunxi/sxirtc.c b/sys/arch/armv7/sunxi/sxirtc.c index b0e0653bc93..32460d6125f 100644 --- a/sys/arch/armv7/sunxi/sxirtc.c +++ b/sys/arch/armv7/sunxi/sxirtc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxirtc.c,v 1.4 2014/04/25 09:49:33 jsg Exp $ */ +/* $OpenBSD: sxirtc.c,v 1.5 2016/01/31 04:39:05 jsg Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * Copyright (c) 2013 Artturi Alm @@ -31,8 +31,8 @@ #include <armv7/armv7/armv7var.h> #include <armv7/sunxi/sunxireg.h> -#define SXIRTC_YYMMDD 0x00 -#define SXIRTC_HHMMSS 0x04 +#define SXIRTC_YYMMDD 0x04 +#define SXIRTC_HHMMSS 0x08 #define LEAPYEAR(y) \ (((y) % 4 == 0 && \ @@ -76,8 +76,8 @@ sxirtc_attach(struct device *parent, struct device *self, void *args) panic("sxirtc_attach: couldn't allocate todr_handle"); sc->sc_iot = aa->aa_iot; - if (bus_space_subregion(sc->sc_iot, sxitimer_ioh, - aa->aa_dev->mem[0].addr, aa->aa_dev->mem[0].size, &sc->sc_ioh)) + if (bus_space_map(sc->sc_iot, aa->aa_dev->mem[0].addr, + aa->aa_dev->mem[0].size, 0, &sc->sc_ioh)) panic("sxirtc_attach: bus_space_subregion failed!"); handle->cookie = self; |