carl9170 firmware: remove bogoclock
[carl9170fw.git] / carlfw / src / timer.c
index 354eaf97dfc7b07780519ef17e1660feacdfb241..14c00e6aad491295f53ca79d077dc0285f95ed7e 100644 (file)
@@ -41,23 +41,6 @@ void timer_init(const unsigned int timer, const unsigned int interval)
        orl(AR9170_TIMER_REG_INTERRUPT, BIT(timer));
 }
 
-static void clock_calibrate(void)
-{
-       uint32_t t0, loop = 13;
-
-       t0 = get_clock_counter();
-
-       /*
-        * TODO:
-        * Write this code in assembler, so the reading is accurate
-        * and can be used to correct the timer intervals.
-        */
-       while (((get_clock_counter() - t0) & (BIT(18)-1)) < 1000)
-               loop += 9;      /* really rough uOP estimation */
-
-       fw.bogoclock = loop;
-}
-
 void clock_set(const bool on, const enum cpu_clock_t _clock)
 {
        /*
@@ -67,7 +50,6 @@ void clock_set(const bool on, const enum cpu_clock_t _clock)
         */
 
        set(AR9170_PWR_REG_CLOCK_SEL, (uint32_t) ((on ? 0x70 : 0x600) | _clock));
-       clock_calibrate();
 }
 
 static void timer0_isr(void)
@@ -78,10 +60,6 @@ static void timer0_isr(void)
        gpio_timer();
 #endif /* CONFIG_CARL9170FW_GPIO_INTERRUPT */
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-       usb_watchdog_timer();
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
-
 #ifdef CONFIG_CARL9170FW_DEBUG_LED_HEARTBEAT
        set(AR9170_GPIO_REG_PORT_DATA, get(AR9170_GPIO_REG_PORT_DATA) ^ 1);
 #endif /* CONFIG_CARL9170FW_DEBUG_LED_HEARTBEAT */