Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iop: enable generic time

This updates the IOP platform to use the kernel's generic time
framework. With clockevent support in place, this reduces to
selecting GENERIC_TIME and removing the platform's private timer
->offset() operation (iop_gettimeoffset).

Tested on n2100, compile-tested for all plat-iop machines.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Mikael Pettersson and committed by
Dan Williams
980f2296 469d3044

+1 -40
+1
arch/arm/Kconfig
··· 811 811 config PLAT_IOP 812 812 bool 813 813 select GENERIC_CLOCKEVENTS 814 + select GENERIC_TIME 814 815 815 816 config PLAT_ORION 816 817 bool
-1
arch/arm/include/asm/hardware/iop3xx.h
··· 234 234 void iop3xx_map_io(void); 235 235 void iop_init_cp6_handler(void); 236 236 void iop_init_time(unsigned long tickrate); 237 - unsigned long iop_gettimeoffset(void); 238 237 239 238 static inline u32 read_tmr0(void) 240 239 {
-1
arch/arm/mach-iop13xx/include/mach/time.h
··· 20 20 #define IOP13XX_CORE_FREQ_1200 (5 << 16) 21 21 22 22 void iop_init_time(unsigned long tickrate); 23 - unsigned long iop_gettimeoffset(void); 24 23 25 24 static inline unsigned long iop13xx_core_freq(void) 26 25 {
-1
arch/arm/mach-iop13xx/iq81340mc.c
··· 87 87 88 88 static struct sys_timer iq81340mc_timer = { 89 89 .init = iq81340mc_timer_init, 90 - .offset = iop_gettimeoffset, 91 90 }; 92 91 93 92 MACHINE_START(IQ81340MC, "Intel IQ81340MC")
-1
arch/arm/mach-iop13xx/iq81340sc.c
··· 89 89 90 90 static struct sys_timer iq81340sc_timer = { 91 91 .init = iq81340sc_timer_init, 92 - .offset = iop_gettimeoffset, 93 92 }; 94 93 95 94 MACHINE_START(IQ81340SC, "Intel IQ81340SC")
-1
arch/arm/mach-iop32x/em7210.c
··· 42 42 43 43 static struct sys_timer em7210_timer = { 44 44 .init = em7210_timer_init, 45 - .offset = iop_gettimeoffset, 46 45 }; 47 46 48 47 /*
-1
arch/arm/mach-iop32x/glantank.c
··· 47 47 48 48 static struct sys_timer glantank_timer = { 49 49 .init = glantank_timer_init, 50 - .offset = iop_gettimeoffset, 51 50 }; 52 51 53 52
-1
arch/arm/mach-iop32x/iq31244.c
··· 78 78 79 79 static struct sys_timer iq31244_timer = { 80 80 .init = iq31244_timer_init, 81 - .offset = iop_gettimeoffset, 82 81 }; 83 82 84 83
-1
arch/arm/mach-iop32x/iq80321.c
··· 46 46 47 47 static struct sys_timer iq80321_timer = { 48 48 .init = iq80321_timer_init, 49 - .offset = iop_gettimeoffset, 50 49 }; 51 50 52 51
-1
arch/arm/mach-iop32x/n2100.c
··· 53 53 54 54 static struct sys_timer n2100_timer = { 55 55 .init = n2100_timer_init, 56 - .offset = iop_gettimeoffset, 57 56 }; 58 57 59 58
-1
arch/arm/mach-iop33x/iq80331.c
··· 48 48 49 49 static struct sys_timer iq80331_timer = { 50 50 .init = iq80331_timer_init, 51 - .offset = iop_gettimeoffset, 52 51 }; 53 52 54 53
-1
arch/arm/mach-iop33x/iq80332.c
··· 48 48 49 49 static struct sys_timer iq80332_timer = { 50 50 .init = iq80332_timer_init, 51 - .offset = iop_gettimeoffset, 52 51 }; 53 52 54 53
-29
arch/arm/plat-iop/time.c
··· 140 140 ce->name, ce->shift, ce->mult); 141 141 } 142 142 143 - static unsigned long ticks_per_usec; 144 - static unsigned long next_jiffy_time; 145 - 146 - unsigned long iop_gettimeoffset(void) 147 - { 148 - unsigned long offset, temp; 149 - 150 - /* enable cp6, if necessary, to avoid taking the overhead of an 151 - * undefined instruction trap 152 - */ 153 - asm volatile ( 154 - "mrc p15, 0, %0, c15, c1, 0\n\t" 155 - "tst %0, #(1 << 6)\n\t" 156 - "orreq %0, %0, #(1 << 6)\n\t" 157 - "mcreq p15, 0, %0, c15, c1, 0\n\t" 158 - #ifdef CONFIG_CPU_XSCALE 159 - "mrceq p15, 0, %0, c15, c1, 0\n\t" 160 - "moveq %0, %0\n\t" 161 - "subeq pc, pc, #4\n\t" 162 - #endif 163 - : "=r"(temp) : : "cc"); 164 - 165 - offset = next_jiffy_time - read_tcr1(); 166 - 167 - return offset / ticks_per_usec; 168 - } 169 - 170 143 static irqreturn_t 171 144 iop_timer_interrupt(int irq, void *dev_id) 172 145 { ··· 169 196 u32 timer_ctl; 170 197 171 198 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); 172 - ticks_per_usec = tick_rate / 1000000; 173 - next_jiffy_time = 0xffffffff; 174 199 iop_tick_rate = tick_rate; 175 200 176 201 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED |