···6565 1. (optional) set up RTC routines6666 2. (optional) calibrate and set the mips_counter_frequency67676868- b) board_timer_setup - a function pointer. Invoked at the end of time_init()6868+ b) plat_timer_setup - a function pointer. Invoked at the end of time_init()6969 1. (optional) over-ride any decisions made in time_init()7070 2. set up the irqaction for timer interrupt.7171 3. enable the timer interrupt···116116117117 If you supply board_time_init(), set the function poointer.118118119119- Set the function pointer board_timer_setup() (mandatory)120119121121-122122-Step 3: implement rtc routines, board_time_init() and board_timer_setup()120120+Step 3: implement rtc routines, board_time_init() and plat_timer_setup()123121 if needed.124122125125- board_time_init() - 123123+ board_time_init() -126124 a) (optional) set up RTC routines, 127125 b) (optional) calibrate and set the mips_counter_frequency128126 (only needed if you intended to use fixed_rate_gettimeoffset129127 or use cpu counter as timer interrupt source)130128131131- board_timer_setup() - 129129+ plat_timer_setup() -132130 a) (optional) over-write any choices made above by time_init().133131 b) machine specific code should setup the timer irqaction.134132 c) enable the timer interrupt
···3737extern void jazz_machine_halt(void);3838extern void jazz_machine_power_off(void);39394040-static void __init jazz_time_init(struct irqaction *irq)4040+void __init plat_time_init(struct irqaction *irq)4141{4242 /* set the clock to 100 Hz */4343 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);···7575 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)7676 request_resource(&ioport_resource, jazz_io_resources + i);77777878- board_timer_setup = jazz_time_init;7978 /* The RTC is outside the port address space */80798180 _machine_restart = jazz_machine_restart;
···577577{578578 /*579579 * Start timer on secondary VPEs if necessary.580580- * mips_timer_setup should already have been invoked by init/main580580+ * plat_timer_setup has already have been invoked by init/main581581 * on "boot" TC. Like per_cpu_trap_init() hack, this assumes that582582 * SMTC init code assigns TCs consdecutively and in ascending order583583 * to across available VPEs.
+2-3
arch/mips/kernel/time.c
···566566 * 2) setup xtime based on rtc_mips_get_time().567567 * 3) choose a appropriate gettimeoffset routine.568568 * 4) calculate a couple of cached variables for later usage569569- * 5) board_timer_setup() -569569+ * 5) plat_timer_setup() -570570 * a) (optional) over-write any choices made above by time_init().571571 * b) machine specific code should setup the timer irqaction.572572 * c) enable the timer interrupt573573 */574574575575void (*board_time_init)(void);576576-void (*board_timer_setup)(struct irqaction *irq);577576578577unsigned int mips_hpt_frequency;579578···717718 * to be NULL function so that we are sure the high-level code718719 * is not invoked accidentally.719720 */720720- board_timer_setup(&timer_irqaction);721721+ plat_timer_setup(&timer_irqaction);721722}722723723724#define FEBRUARY 2
···7070 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));7171}72727373-/*7474- * pnx8550_timer_setup() - it does the following things:7575- *7676- * 5) board_timer_setup() -7777- * a) (optional) over-write any choices made above by time_init().7878- * b) machine specific code should setup the timer irqaction.7979- * c) enable the timer interrupt8080- */8181-8282-void __init pnx8550_timer_setup(struct irqaction *irq)7373+void __init plat_timer_setup(struct irqaction *irq)8374{8475 int configPR;8576
···7777#endif7878}79798080-void __init swarm_timer_setup(struct irqaction *irq)8080+void __init plat_timer_setup(struct irqaction *irq)8181{8282 /*8383 * we don't set up irqaction, because we will deliver timer···117117 panic_timeout = 5; /* For debug. */118118119119 board_time_init = swarm_time_init;120120- board_timer_setup = swarm_timer_setup;121120 board_be_handler = swarm_be_handler;122121123122 if (xicor_probe()) {
···8383/*8484 * board specific routines required by time_init().8585 * board_time_init is defaulted to NULL and can remain so.8686- * board_timer_setup must be setup properly in machine setup routine.8686+ * plat_timer_setup must be setup properly in machine setup routine.8787 */8888struct irqaction;8989extern void (*board_time_init)(void);9090-extern void (*board_timer_setup)(struct irqaction *irq);9090+extern void plat_timer_setup(struct irqaction *irq);91919292/*9393 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible