From 1591de53b123abd03a595cfee01203fa52795fd5 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 15 Jun 2012 06:38:55 +0000 Subject: [PATCH] Take half a step closer towards having a unified atmel kernel by rearranging where we initialize the time counter and putting the common stubs into a central place. --- sys/arm/at91/at91_machdep.c | 21 +++++++++++++++++++++ sys/arm/at91/at91_pit.c | 21 --------------------- sys/arm/at91/at91_st.c | 20 +++++++------------- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c index 468b4c01ca14..63aa644adb13 100644 --- a/sys/arm/at91/at91_machdep.c +++ b/sys/arm/at91/at91_machdep.c @@ -572,3 +572,24 @@ initarm(struct arm_boot_params *abp) return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } + +/* + * These functions are handled elsewhere, so make them nops here. + */ +void +cpu_startprofclock(void) +{ + +} + +void +cpu_stopprofclock(void) +{ + +} + +void +cpu_initclocks(void) +{ + +} diff --git a/sys/arm/at91/at91_pit.c b/sys/arm/at91/at91_pit.c index 693dae86ecf2..4eb8f0f2fb6c 100644 --- a/sys/arm/at91/at91_pit.c +++ b/sys/arm/at91/at91_pit.c @@ -206,24 +206,3 @@ DELAY(int us) last = piv; } } - -/* - * The 3 next functions must be implement with the future PLL code. - */ -void -cpu_startprofclock(void) -{ - -} - -void -cpu_stopprofclock(void) -{ - -} - -void -cpu_initclocks(void) -{ - -} diff --git a/sys/arm/at91/at91_st.c b/sys/arm/at91/at91_st.c index ac20bc183406..6203fb2e633f 100644 --- a/sys/arm/at91/at91_st.c +++ b/sys/arm/at91/at91_st.c @@ -60,6 +60,7 @@ static struct at91st_softc { bus_space_write_4(timer_softc->sc_st, timer_softc->sc_sh, (off), (val)) static void at91st_watchdog(void *, u_int, int *); +static void at91st_initclocks(struct at91st_softc *); static inline int st_crtr(void) @@ -114,8 +115,11 @@ at91st_attach(device_t dev) timer_softc->sc_wet = EVENTHANDLER_REGISTER(watchdog_list, at91st_watchdog, dev, 0); + device_printf(dev, "watchdog registered, timeout intervall max. 64 sec\n"); + + at91st_initclocks(timer_softc); return (0); } @@ -183,14 +187,14 @@ clock_intr(void *arg) return (FILTER_STRAY); } -void -cpu_initclocks(void) +static void +at91st_initclocks(struct at91st_softc *sc) { int rel_value; struct resource *irq; int rid = 0; void *ih; - device_t dev = timer_softc->sc_dev; + device_t dev = sc->sc_dev; rel_value = 32768 / hz; if (rel_value < 1) @@ -251,13 +255,3 @@ cpu_reset(void) while (1) continue; } - -void -cpu_startprofclock(void) -{ -} - -void -cpu_stopprofclock(void) -{ -}