aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/mpcore_timer.c19
-rw-r--r--sys/arm/ti/omap4/omap4_prcm_clks.c6
2 files changed, 19 insertions, 6 deletions
diff --git a/sys/arm/arm/mpcore_timer.c b/sys/arm/arm/mpcore_timer.c
index 8445d3df40cf..42ba289265f3 100644
--- a/sys/arm/arm/mpcore_timer.c
+++ b/sys/arm/arm/mpcore_timer.c
@@ -115,6 +115,8 @@ static struct resource_spec arm_tmr_spec[] = {
static struct arm_tmr_softc *arm_tmr_sc = NULL;
+uint32_t platform_arm_tmr_freq = 0;
+
#define tmr_prv_read_4(reg) \
bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg)
#define tmr_prv_write_4(reg, val) \
@@ -274,13 +276,18 @@ arm_tmr_attach(device_t dev)
if (arm_tmr_sc)
return (ENXIO);
- /* Get the base clock frequency */
- node = ofw_bus_get_node(dev);
- if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) <= 0) {
- device_printf(dev, "missing clock-frequency attribute in FDT\n");
- return (ENXIO);
+ if (platform_arm_tmr_freq != 0)
+ sc->clkfreq = platform_arm_tmr_freq;
+ else {
+ /* Get the base clock frequency */
+ node = ofw_bus_get_node(dev);
+ if ((OF_getprop(node, "clock-frequency", &clock,
+ sizeof(clock))) <= 0) {
+ device_printf(dev, "missing clock-frequency attribute in FDT\n");
+ return (ENXIO);
+ }
+ sc->clkfreq = fdt32_to_cpu(clock);
}
- sc->clkfreq = fdt32_to_cpu(clock);
if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) {
diff --git a/sys/arm/ti/omap4/omap4_prcm_clks.c b/sys/arm/ti/omap4/omap4_prcm_clks.c
index 16636d74ccf5..8217bf121112 100644
--- a/sys/arm/ti/omap4/omap4_prcm_clks.c
+++ b/sys/arm/ti/omap4/omap4_prcm_clks.c
@@ -1384,10 +1384,14 @@ omap4_prcm_probe(device_t dev)
* RETURNS:
* Always returns 0
*/
+
+extern uint32_t platform_arm_tmr_freq;
+
static int
omap4_prcm_attach(device_t dev)
{
struct omap4_prcm_softc *sc = device_get_softc(dev);
+ unsigned int freq;
if (bus_alloc_resources(dev, omap4_scm_res_spec, sc->sc_res)) {
device_printf(dev, "could not allocate resources\n");
@@ -1396,6 +1400,8 @@ omap4_prcm_attach(device_t dev)
omap4_prcm_sc = sc;
ti_cpu_reset = omap4_prcm_reset;
+ omap4_clk_get_arm_fclk_freq(NULL, &freq);
+ platform_arm_tmr_freq = freq / 2;
return (0);
}