Skip to content

Commit 4b55048

Browse files
committed
[MIPS] Deforest the function pointer jungle in the time code.
Hard to follow who is pointing what to where and why so it's simply getting in the way of the time code renovation. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent f5ff0a2 commit 4b55048

44 files changed

Lines changed: 114 additions & 209 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/mips/au1000/common/setup.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ extern void au1000_halt(void);
5050
extern void au1000_power_off(void);
5151
extern void au1x_time_init(void);
5252
extern void au1x_timer_setup(struct irqaction *irq);
53-
extern void au1xxx_time_init(void);
5453
extern void set_cpuspec(void);
5554

5655
void __init plat_mem_setup(void)
@@ -112,7 +111,6 @@ void __init plat_mem_setup(void)
112111
_machine_restart = au1000_restart;
113112
_machine_halt = au1000_halt;
114113
pm_power_off = au1000_power_off;
115-
board_time_init = au1xxx_time_init;
116114

117115
/* IO/MEM resources. */
118116
set_io_port_base(0);

‎arch/mips/au1000/common/time.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,3 @@ void __init plat_timer_setup(struct irqaction *irq)
329329

330330
#endif
331331
}
332-
333-
void __init au1xxx_time_init(void)
334-
{
335-
}

‎arch/mips/basler/excite/excite_setup.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ DEFINE_SPINLOCK(titan_lock);
6868
int titan_irqflags;
6969

7070

71-
static void excite_timer_init(void)
71+
void __init plat_time_init(void)
7272
{
7373
const u32 modebit5 = ocd_readl(0x00e4);
7474
unsigned int
@@ -261,9 +261,6 @@ void __init plat_mem_setup(void)
261261
/* Announce RAM to system */
262262
add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
263263

264-
/* Set up timer initialization hooks */
265-
board_time_init = excite_timer_init;
266-
267264
/* Set up the peripheral address map */
268265
*(boot_ocd_base + (LKB9 / sizeof (u32))) = 0;
269266
*(boot_ocd_base + (LKB10 / sizeof (u32))) = 0;

‎arch/mips/bcm47xx/setup.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,5 @@ void __init plat_mem_setup(void)
119119
_machine_restart = bcm47xx_machine_restart;
120120
_machine_halt = bcm47xx_machine_halt;
121121
pm_power_off = bcm47xx_machine_halt;
122-
board_time_init = bcm47xx_time_init;
123122
}
124123

‎arch/mips/bcm47xx/time.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#include <asm/time.h>
2929
#include <bcm47xx.h>
3030

31-
void __init
32-
bcm47xx_time_init(void)
31+
void __init plat_time_init(void)
3332
{
3433
unsigned long hz;
3534

‎arch/mips/dec/setup.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,9 @@ static void __init dec_be_init(void)
145145
}
146146
}
147147

148-
149-
extern void dec_time_init(void);
150-
151148
void __init plat_mem_setup(void)
152149
{
153150
board_be_init = dec_be_init;
154-
board_time_init = dec_time_init;
155151

156152
wbflush_setup();
157153

‎arch/mips/dec/time.c‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <asm/dec/ioasic_addrs.h>
3636
#include <asm/dec/machtype.h>
3737

38-
static unsigned long dec_rtc_get_time(void)
38+
unsigned long read_persistent_clock(void)
3939
{
4040
unsigned int year, mon, day, hour, min, sec, real_year;
4141
unsigned long flags;
@@ -74,13 +74,13 @@ static unsigned long dec_rtc_get_time(void)
7474
}
7575

7676
/*
77-
* In order to set the CMOS clock precisely, dec_rtc_set_mmss has to
77+
* In order to set the CMOS clock precisely, rtc_mips_set_mmss has to
7878
* be called 500 ms after the second nowtime has started, because when
7979
* nowtime is written into the registers of the CMOS clock, it will
8080
* jump to the next second precisely 500 ms later. Check the Dallas
8181
* DS1287 data sheet for details.
8282
*/
83-
static int dec_rtc_set_mmss(unsigned long nowtime)
83+
int rtc_mips_set_mmss(unsigned long nowtime)
8484
{
8585
int retval = 0;
8686
int real_seconds, real_minutes, cmos_minutes;
@@ -139,7 +139,6 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
139139
return retval;
140140
}
141141

142-
143142
static int dec_timer_state(void)
144143
{
145144
return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
@@ -160,11 +159,8 @@ static cycle_t dec_ioasic_hpt_read(void)
160159
}
161160

162161

163-
void __init dec_time_init(void)
162+
void __init plat_time_init(void)
164163
{
165-
rtc_mips_get_time = dec_rtc_get_time;
166-
rtc_mips_set_mmss = dec_rtc_set_mmss;
167-
168164
mips_timer_state = dec_timer_state;
169165
mips_timer_ack = dec_timer_ack;
170166

‎arch/mips/emma2rh/markeins/setup.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static unsigned int __init detect_bus_frequency(unsigned long rtc_base)
8888
return clock[reg];
8989
}
9090

91-
static void __init emma2rh_time_init(void)
91+
void __init plat_time_init(void)
9292
{
9393
u32 reg;
9494
if (bus_frequency == 0)
@@ -124,8 +124,6 @@ void __init plat_mem_setup(void)
124124

125125
set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE));
126126

127-
board_time_init = emma2rh_time_init;
128-
129127
_machine_restart = markeins_machine_restart;
130128
_machine_halt = markeins_machine_halt;
131129
pm_power_off = markeins_machine_power_off;

‎arch/mips/gt64120/wrppmc/setup.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ static void wrppmc_setup_serial(void)
126126

127127
void __init plat_mem_setup(void)
128128
{
129-
extern void wrppmc_time_init(void);
130129
extern void wrppmc_machine_restart(char *command);
131130
extern void wrppmc_machine_halt(void);
132131
extern void wrppmc_machine_power_off(void);
@@ -135,9 +134,6 @@ void __init plat_mem_setup(void)
135134
_machine_halt = wrppmc_machine_halt;
136135
pm_power_off = wrppmc_machine_power_off;
137136

138-
/* Use MIPS Count/Compare Timer */
139-
board_time_init = wrppmc_time_init;
140-
141137
/* This makes the operations of 'in/out[bwl]' to the
142138
* physical address ( < KSEG0) can work via KSEG1
143139
*/

‎arch/mips/gt64120/wrppmc/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void __init plat_timer_setup(struct irqaction *irq)
3838
* NOTE: We disable all GT64120 timers, and use MIPS processor internal
3939
* timer as the source of kernel clock tick.
4040
*/
41-
void __init wrppmc_time_init(void)
41+
void __init plat_time_init(void)
4242
{
4343
/* Disable GT64120 timers */
4444
GT_WRITE(GT_TC_CONTROL_OFS, 0x00);

0 commit comments

Comments
 (0)