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.
This commit is contained in:
Ian Lepore 2014-02-28 00:23:04 +00:00
parent e63cfcf56e
commit f7bcea1a3c

View File

@ -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);