From: Christian Lamparter Date: Thu, 30 Sep 2010 15:52:59 +0000 (+0200) Subject: carl9170 firmware: remove bogoclock X-Git-Tag: 1.9.0~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c1d4716037319ad03fa29cbe56d7cb8c3af67472;p=carl9170fw.git carl9170 firmware: remove bogoclock There's no need to measure the cpu clock. The internal clock source is (always) set to 80Mhz and only timer 0 to 3 are affected by under-/overclocking. Signed-off-by: Christian Lamparter --- diff --git a/carlfw/include/carl9170.h b/carlfw/include/carl9170.h index 0878473..97c5705 100644 --- a/carlfw/include/carl9170.h +++ b/carlfw/include/carl9170.h @@ -70,7 +70,6 @@ enum carl9170_mac_reset_state { struct firmware_context_struct { /* timer / clocks */ - unsigned int bogoclock; /* supposed to be CPU clock in KHz */ unsigned int counter; /* main() cycles */ /* misc */ diff --git a/carlfw/src/fw.c b/carlfw/src/fw.c index 9ec963b..fe16975 100644 --- a/carlfw/src/fw.c +++ b/carlfw/src/fw.c @@ -89,7 +89,7 @@ const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = { .release = CARL9170FW_VERSION_GIT), FILL(dbg, DBG, - .bogoclock_addr = cpu_to_le32(&fw.bogoclock), + .bogoclock_addr = cpu_to_le32(0), .counter_addr = cpu_to_le32(&fw.counter), .rx_total_addr = cpu_to_le32(&fw.wlan.rx_total), .rx_overrun_addr = cpu_to_le32(&fw.wlan.rx_overruns), diff --git a/carlfw/src/timer.c b/carlfw/src/timer.c index 7cbd196..14c00e6 100644 --- a/carlfw/src/timer.c +++ b/carlfw/src/timer.c @@ -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)