static void mt_gpt_init(void) { int i; unsigned long save_flags; gpt_update_lock(save_flags); gpt_devs_init(); for (i = 0; i < NR_GPTS; i++) { __gpt_reset(&gpt_devs[i]); } setup_clkevt(); setup_clksrc(); if (CHIP_SW_VER_01 <= mt_get_chip_sw_ver()) { setup_syscnt_assist(); } setup_syscnt(); //if(GPT_SYSCNT_ASSIST_EN == gpt_syscount_assist_en) if (CHIP_SW_VER_01 <= mt_get_chip_sw_ver()) { start_syscnt_assist(); } gpt_update_unlock(save_flags); }
static void mt_gpt_init(void) { int i; unsigned long save_flags; boot_time_value = xgpt_boot_up_time(); /*record the time when init GPT*/ gpt_update_lock(save_flags); gpt_devs_init(); for (i = 0; i < NR_GPTS; i++) { __gpt_reset(&gpt_devs[i]); } setup_clkevt(); setup_clksrc(); #if 1 //fix me after bring up // if (CHIP_SW_VER_01 <= mt_get_chip_sw_ver()) { // setup_syscnt_assist(); //} #endif setup_syscnt(); #if 1 //fix me after bring up // if (CHIP_SW_VER_01 <= mt_get_chip_sw_ver()) { // start_syscnt_assist(); //} #endif gpt_update_unlock(save_flags); }
static void __init mt_gpt_init(struct device_node *node) { int i; u32 freq; unsigned long save_flags; gpt_update_lock(save_flags); /* freq=SYS_CLK_RATE */ if (of_property_read_u32(node, "clock-frequency", &freq)) pr_err("clock-frequency not set in the .dts file"); /* Setup IRQ numbers */ xgpt_timers.tmr_irq = irq_of_parse_and_map(node, 0); /* Setup IO addresses */ xgpt_timers.tmr_regs = of_iomap(node, 0); boot_time_value = xgpt_boot_up_time(); /*record the time when init GPT*/ pr_alert("mt_gpt_init: tmr_regs=0x%lx, tmr_irq=%d, freq=%d\n", (unsigned long)xgpt_timers.tmr_regs, xgpt_timers.tmr_irq, freq); gpt_devs_init(); for (i = 0; i < NR_GPTS; i++) __gpt_reset(&gpt_devs[i]); setup_clksrc(freq); setup_irq(xgpt_timers.tmr_irq, &gpt_irq); setup_clkevt(freq); /* use cpuxgpt as syscnt */ setup_syscnt(); pr_alert("mt_gpt_init: get_cnt_GPT2=%lld\n", mt_gpt_read(NULL)); /* /TODO: remove */ gpt_update_unlock(save_flags); }