1 #ifndef _IOP13XX_TIME_H_
2 #define _IOP13XX_TIME_H_
3 #define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0
5 #define IOP_TMR_EN 0x02
6 #define IOP_TMR_RELOAD 0x04
7 #define IOP_TMR_PRIVILEGED 0x08
8 #define IOP_TMR_RATIO_1_1 0x00
10 void iop_init_time(unsigned long tickrate
);
11 unsigned long iop_gettimeoffset(void);
13 static inline void write_tmr0(u32 val
)
15 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val
));
18 static inline void write_tmr1(u32 val
)
20 asm volatile("mcr p6, 0, %0, c1, c9, 0" : : "r" (val
));
23 static inline u32
read_tcr0(void)
26 asm volatile("mrc p6, 0, %0, c2, c9, 0" : "=r" (val
));
30 static inline u32
read_tcr1(void)
33 asm volatile("mrc p6, 0, %0, c3, c9, 0" : "=r" (val
));
37 static inline void write_trr0(u32 val
)
39 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val
));
42 static inline void write_trr1(u32 val
)
44 asm volatile("mcr p6, 0, %0, c5, c9, 0" : : "r" (val
));
47 static inline void write_tisr(u32 val
)
49 asm volatile("mcr p6, 0, %0, c6, c9, 0" : : "r" (val
));