You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[MIPS] Replace board_timer_setup function pointer by plat_timer_setup.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org> ---
This commit is contained in:
@@ -65,7 +65,7 @@ the following functions or values:
|
||||
1. (optional) set up RTC routines
|
||||
2. (optional) calibrate and set the mips_counter_frequency
|
||||
|
||||
b) board_timer_setup - a function pointer. Invoked at the end of time_init()
|
||||
b) plat_timer_setup - a function pointer. Invoked at the end of time_init()
|
||||
1. (optional) over-ride any decisions made in time_init()
|
||||
2. set up the irqaction for timer interrupt.
|
||||
3. enable the timer interrupt
|
||||
@@ -116,19 +116,17 @@ Step 2: the machine setup() function
|
||||
|
||||
If you supply board_time_init(), set the function poointer.
|
||||
|
||||
Set the function pointer board_timer_setup() (mandatory)
|
||||
|
||||
|
||||
Step 3: implement rtc routines, board_time_init() and board_timer_setup()
|
||||
Step 3: implement rtc routines, board_time_init() and plat_timer_setup()
|
||||
if needed.
|
||||
|
||||
board_time_init() -
|
||||
board_time_init() -
|
||||
a) (optional) set up RTC routines,
|
||||
b) (optional) calibrate and set the mips_counter_frequency
|
||||
(only needed if you intended to use fixed_rate_gettimeoffset
|
||||
or use cpu counter as timer interrupt source)
|
||||
|
||||
board_timer_setup() -
|
||||
plat_timer_setup() -
|
||||
a) (optional) over-write any choices made above by time_init().
|
||||
b) machine specific code should setup the timer irqaction.
|
||||
c) enable the timer interrupt
|
||||
|
||||
@@ -51,7 +51,6 @@ extern void au1000_power_off(void);
|
||||
extern void au1x_time_init(void);
|
||||
extern void au1x_timer_setup(struct irqaction *irq);
|
||||
extern void au1xxx_time_init(void);
|
||||
extern void au1xxx_timer_setup(struct irqaction *irq);
|
||||
extern void set_cpuspec(void);
|
||||
|
||||
void __init plat_mem_setup(void)
|
||||
@@ -123,7 +122,6 @@ void __init plat_mem_setup(void)
|
||||
_machine_halt = au1000_halt;
|
||||
pm_power_off = au1000_power_off;
|
||||
board_time_init = au1xxx_time_init;
|
||||
board_timer_setup = au1xxx_timer_setup;
|
||||
|
||||
/* IO/MEM resources. */
|
||||
set_io_port_base(0);
|
||||
|
||||
@@ -383,7 +383,7 @@ static unsigned long do_fast_pm_gettimeoffset(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void __init au1xxx_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
unsigned int est_freq;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ static void excite_timer_init(void)
|
||||
mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2;
|
||||
}
|
||||
|
||||
static void excite_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
/* The eXcite platform uses the alternate timer interrupt */
|
||||
set_c0_intcontrol(0x80);
|
||||
@@ -262,7 +262,6 @@ void __init plat_mem_setup(void)
|
||||
|
||||
/* Set up timer initialization hooks */
|
||||
board_time_init = excite_timer_init;
|
||||
board_timer_setup = excite_timer_setup;
|
||||
|
||||
/* Set up the peripheral address map */
|
||||
*(boot_ocd_base + (LKB9 / sizeof (u32))) = 0;
|
||||
|
||||
@@ -49,7 +49,7 @@ const char *get_system_type(void)
|
||||
return "MIPS Cobalt";
|
||||
}
|
||||
|
||||
static void __init cobalt_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
/* Load timer value for 1KHz (TCLK is 50MHz) */
|
||||
GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS);
|
||||
@@ -129,8 +129,6 @@ void __init plat_mem_setup(void)
|
||||
_machine_halt = cobalt_machine_halt;
|
||||
pm_power_off = cobalt_machine_power_off;
|
||||
|
||||
board_timer_setup = cobalt_timer_setup;
|
||||
|
||||
set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE));
|
||||
|
||||
/* I/O port resource must include UART and LCD/buttons */
|
||||
|
||||
@@ -147,7 +147,7 @@ static void __init ddb_time_init(void)
|
||||
mips_hpt_frequency = bus_frequency*(i+4)/4;
|
||||
}
|
||||
|
||||
static void __init ddb_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
#if defined(USE_CPU_COUNTER_TIMER)
|
||||
|
||||
@@ -177,7 +177,6 @@ void __init plat_mem_setup(void)
|
||||
set_io_port_base(KSEG1ADDR(DDB_PCI_IO_BASE));
|
||||
|
||||
board_time_init = ddb_time_init;
|
||||
board_timer_setup = ddb_timer_setup;
|
||||
|
||||
_machine_restart = ddb_machine_restart;
|
||||
_machine_halt = ddb_machine_halt;
|
||||
|
||||
@@ -145,13 +145,11 @@ static void __init dec_be_init(void)
|
||||
|
||||
|
||||
extern void dec_time_init(void);
|
||||
extern void dec_timer_setup(struct irqaction *);
|
||||
|
||||
void __init plat_mem_setup(void)
|
||||
{
|
||||
board_be_init = dec_be_init;
|
||||
board_time_init = dec_time_init;
|
||||
board_timer_setup = dec_timer_setup;
|
||||
|
||||
wbflush_setup();
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ void __init dec_time_init(void)
|
||||
|
||||
EXPORT_SYMBOL(do_settimeofday);
|
||||
|
||||
void __init dec_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
setup_irq(dec_interrupt[DEC_IRQ_RTC], irq);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ static void __init emma2rh_time_init(void)
|
||||
mips_hpt_frequency = (bus_frequency * (4 + reg)) / 4 / 2;
|
||||
}
|
||||
|
||||
static void __init emma2rh_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
/* we are using the cpu counter for timer interrupts */
|
||||
setup_irq(CPU_IRQ_BASE + 7, irq);
|
||||
@@ -149,7 +149,6 @@ void __init plat_mem_setup(void)
|
||||
set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE));
|
||||
|
||||
board_time_init = emma2rh_time_init;
|
||||
board_timer_setup = emma2rh_timer_setup;
|
||||
|
||||
_machine_restart = markeins_machine_restart;
|
||||
_machine_halt = markeins_machine_halt;
|
||||
|
||||
@@ -127,7 +127,6 @@ static void wrppmc_setup_serial(void)
|
||||
void __init plat_mem_setup(void)
|
||||
{
|
||||
extern void wrppmc_time_init(void);
|
||||
extern void wrppmc_timer_setup(struct irqaction *);
|
||||
extern void wrppmc_machine_restart(char *command);
|
||||
extern void wrppmc_machine_halt(void);
|
||||
extern void wrppmc_machine_power_off(void);
|
||||
@@ -138,7 +137,6 @@ void __init plat_mem_setup(void)
|
||||
|
||||
/* Use MIPS Count/Compare Timer */
|
||||
board_time_init = wrppmc_time_init;
|
||||
board_timer_setup = wrppmc_timer_setup;
|
||||
|
||||
/* This makes the operations of 'in/out[bwl]' to the
|
||||
* physical address ( < KSEG0) can work via KSEG1
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
|
||||
|
||||
void __init wrppmc_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
/* Install ISR for timer interrupt */
|
||||
setup_irq(WRPPMC_MIPS_TIMER_IRQ, irq);
|
||||
|
||||
@@ -60,7 +60,6 @@ extern void it8172_halt(void);
|
||||
extern void it8172_power_off(void);
|
||||
|
||||
extern void it8172_time_init(void);
|
||||
extern void it8172_timer_setup(struct irqaction *irq);
|
||||
|
||||
#ifdef CONFIG_IT8172_REVC
|
||||
struct {
|
||||
@@ -168,7 +167,6 @@ void __init plat_mem_setup(void)
|
||||
clear_c0_status(ST0_FR);
|
||||
|
||||
board_time_init = it8172_time_init;
|
||||
board_timer_setup = it8172_timer_setup;
|
||||
|
||||
_machine_restart = it8172_restart;
|
||||
_machine_halt = it8172_halt;
|
||||
|
||||
@@ -233,7 +233,8 @@ void __init it8172_time_init(void)
|
||||
}
|
||||
|
||||
#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
|
||||
void __init it8172_timer_setup(struct irqaction *irq)
|
||||
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
puts("timer_setup\n");
|
||||
put32(NR_IRQS);
|
||||
|
||||
@@ -37,7 +37,7 @@ extern void jazz_machine_restart(char *command);
|
||||
extern void jazz_machine_halt(void);
|
||||
extern void jazz_machine_power_off(void);
|
||||
|
||||
static void __init jazz_time_init(struct irqaction *irq)
|
||||
void __init plat_time_init(struct irqaction *irq)
|
||||
{
|
||||
/* set the clock to 100 Hz */
|
||||
r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
|
||||
@@ -75,7 +75,6 @@ void __init plat_mem_setup(void)
|
||||
for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
|
||||
request_resource(&ioport_resource, jazz_io_resources + i);
|
||||
|
||||
board_timer_setup = jazz_time_init;
|
||||
/* The RTC is outside the port address space */
|
||||
|
||||
_machine_restart = jazz_machine_restart;
|
||||
|
||||
@@ -185,7 +185,7 @@ static void __init jmr3927_time_init(void)
|
||||
|
||||
unsigned long jmr3927_do_gettimeoffset(void);
|
||||
|
||||
static void __init jmr3927_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
do_gettimeoffset = jmr3927_do_gettimeoffset;
|
||||
|
||||
@@ -244,7 +244,6 @@ void __init plat_mem_setup(void)
|
||||
set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO);
|
||||
|
||||
board_time_init = jmr3927_time_init;
|
||||
board_timer_setup = jmr3927_timer_setup;
|
||||
|
||||
_machine_restart = jmr3927_machine_restart;
|
||||
_machine_halt = jmr3927_machine_halt;
|
||||
|
||||
@@ -577,7 +577,7 @@ void smtc_init_secondary(void)
|
||||
{
|
||||
/*
|
||||
* Start timer on secondary VPEs if necessary.
|
||||
* mips_timer_setup should already have been invoked by init/main
|
||||
* plat_timer_setup has already have been invoked by init/main
|
||||
* on "boot" TC. Like per_cpu_trap_init() hack, this assumes that
|
||||
* SMTC init code assigns TCs consdecutively and in ascending order
|
||||
* to across available VPEs.
|
||||
|
||||
@@ -566,14 +566,13 @@ asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs)
|
||||
* 2) setup xtime based on rtc_mips_get_time().
|
||||
* 3) choose a appropriate gettimeoffset routine.
|
||||
* 4) calculate a couple of cached variables for later usage
|
||||
* 5) board_timer_setup() -
|
||||
* 5) plat_timer_setup() -
|
||||
* a) (optional) over-write any choices made above by time_init().
|
||||
* b) machine specific code should setup the timer irqaction.
|
||||
* c) enable the timer interrupt
|
||||
*/
|
||||
|
||||
void (*board_time_init)(void);
|
||||
void (*board_timer_setup)(struct irqaction *irq);
|
||||
|
||||
unsigned int mips_hpt_frequency;
|
||||
|
||||
@@ -718,7 +717,7 @@ void __init time_init(void)
|
||||
* to be NULL function so that we are sure the high-level code
|
||||
* is not invoked accidentally.
|
||||
*/
|
||||
board_timer_setup(&timer_irqaction);
|
||||
plat_timer_setup(&timer_irqaction);
|
||||
}
|
||||
|
||||
#define FEBRUARY 2
|
||||
|
||||
@@ -115,12 +115,9 @@ static void lasat_time_init(void)
|
||||
mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
|
||||
}
|
||||
|
||||
static void lasat_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
|
||||
write_c0_compare(
|
||||
read_c0_count() +
|
||||
mips_hpt_frequency / HZ);
|
||||
write_c0_compare( read_c0_count() + mips_hpt_frequency / HZ);
|
||||
change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
|
||||
}
|
||||
|
||||
@@ -170,7 +167,6 @@ void __init plat_mem_setup(void)
|
||||
lasat_reboot_setup();
|
||||
|
||||
board_time_init = lasat_time_init;
|
||||
board_timer_setup = lasat_timer_setup;
|
||||
|
||||
#ifdef CONFIG_DS1603
|
||||
ds1603 = &ds_defs[mips_machtype];
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
extern void mips_reboot_setup(void);
|
||||
extern void mips_time_init(void);
|
||||
extern void mips_timer_setup(struct irqaction *irq);
|
||||
extern unsigned long mips_rtc_get_time(void);
|
||||
|
||||
#ifdef CONFIG_KGDB
|
||||
@@ -63,7 +62,6 @@ void __init plat_mem_setup(void)
|
||||
mips_reboot_setup();
|
||||
|
||||
board_time_init = mips_time_init;
|
||||
board_timer_setup = mips_timer_setup;
|
||||
rtc_mips_get_time = mips_rtc_get_time;
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ void __init mips_time_init(void)
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
void __init mips_timer_setup(struct irqaction *irq)
|
||||
void __init plat_timer_setup(struct irqaction *irq)
|
||||
{
|
||||
if (cpu_has_veic) {
|
||||
set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user