aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/arm/mpcore_timer.c
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2014-02-28 00:23:04 +0000
committerIan Lepore <ian@FreeBSD.org>2014-02-28 00:23:04 +0000
commitf7bcea1a3ceb0b0d3d115c853a1c5b1811e81b62 (patch)
treefc56b3ef405d15383f7f109648e181168f184a5e /sys/arm/arm/mpcore_timer.c
parente63cfcf56e74cf72734d65b1aa2e4a8bac469c4c (diff)
downloadsrc-f7bcea1a3ceb0b0d3d115c853a1c5b1811e81b62.tar.gz
src-f7bcea1a3ceb0b0d3d115c853a1c5b1811e81b62.zip
Supply a DELAY() implementation via weak linkage, so that SoC-specific
code can supply a better implementation. A SoC with variable CPU frequency is likely to use a fixed-frequency timer for DELAY() (but still use the mpcore private timers as eventtimers). Also remove spaces from the eventtimer and timecounter names.
Notes
Notes: svn path=/head/; revision=262584
Diffstat (limited to 'sys/arm/arm/mpcore_timer.c')
-rw-r--r--sys/arm/arm/mpcore_timer.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/arm/arm/mpcore_timer.c b/sys/arm/arm/mpcore_timer.c
index 719685980e57..19f41301e703 100644
--- a/sys/arm/arm/mpcore_timer.c
+++ b/sys/arm/arm/mpcore_timer.c
@@ -129,12 +129,12 @@ uint32_t platform_arm_tmr_freq = 0;
static timecounter_get_t arm_tmr_get_timecount;
static struct timecounter arm_tmr_timecount = {
- .tc_name = "ARM MPCore Timecounter",
+ .tc_name = "MPCore",
.tc_get_timecount = arm_tmr_get_timecount,
.tc_poll_pps = NULL,
.tc_counter_mask = ~0u,
.tc_frequency = 0,
- .tc_quality = 1000,
+ .tc_quality = 800,
};
/**
@@ -254,7 +254,7 @@ arm_tmr_probe(device_t dev)
if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers"))
return (ENXIO);
- device_set_desc(dev, "ARM Generic MPCore Timers");
+ device_set_desc(dev, "ARM MPCore Timers");
return (BUS_PROBE_DEFAULT);
}
@@ -327,7 +327,7 @@ arm_tmr_attach(device_t dev)
return (ENXIO);
}
- sc->et.et_name = "ARM MPCore Eventtimer";
+ sc->et.et_name = "MPCore";
sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU;
sc->et.et_quality = 1000;
@@ -369,8 +369,8 @@ DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0);
* RETURNS:
* nothing
*/
-void
-DELAY(int usec)
+static void
+arm_tmr_DELAY(int usec)
{
int32_t counts_per_usec;
int32_t counts;
@@ -408,3 +408,11 @@ DELAY(int usec)
first = last;
}
}
+
+/*
+ * Supply a DELAY() implementation via weak linkage. A platform may want to use
+ * the mpcore per-cpu eventtimers but provide its own DELAY() routine,
+ * especially when the core frequency can change on the fly.
+ */
+__weak_reference(arm_tmr_DELAY, DELAY);
+