~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-iop13xx/include/mach/time.h

Version: ~ [ linux-5.8-rc3 ] ~ [ linux-5.7.5 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.48 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.129 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.185 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.228 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.228 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _IOP13XX_TIME_H_
  2 #define _IOP13XX_TIME_H_
  3 #define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0
  4 
  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
  9 
 10 #define IOP13XX_XSI_FREQ_RATIO_MASK     (3 << 19)
 11 #define IOP13XX_XSI_FREQ_RATIO_2        (0 << 19)
 12 #define IOP13XX_XSI_FREQ_RATIO_3        (1 << 19)
 13 #define IOP13XX_XSI_FREQ_RATIO_4        (2 << 19)
 14 #define IOP13XX_CORE_FREQ_MASK          (7 << 16)
 15 #define IOP13XX_CORE_FREQ_600           (0 << 16)
 16 #define IOP13XX_CORE_FREQ_667           (1 << 16)
 17 #define IOP13XX_CORE_FREQ_800           (2 << 16)
 18 #define IOP13XX_CORE_FREQ_933           (3 << 16)
 19 #define IOP13XX_CORE_FREQ_1000          (4 << 16)
 20 #define IOP13XX_CORE_FREQ_1200          (5 << 16)
 21 
 22 void iop_init_time(unsigned long tickrate);
 23 
 24 static inline unsigned long iop13xx_core_freq(void)
 25 {
 26         unsigned long freq = __raw_readl(IOP13XX_PROCESSOR_FREQ);
 27         freq &= IOP13XX_CORE_FREQ_MASK;
 28         switch (freq) {
 29         case IOP13XX_CORE_FREQ_600:
 30                 return 600000000;
 31         case IOP13XX_CORE_FREQ_667:
 32                 return 667000000;
 33         case IOP13XX_CORE_FREQ_800:
 34                 return 800000000;
 35         case IOP13XX_CORE_FREQ_933:
 36                 return 933000000;
 37         case IOP13XX_CORE_FREQ_1000:
 38                 return 1000000000;
 39         case IOP13XX_CORE_FREQ_1200:
 40                 return 1200000000;
 41         default:
 42                 printk("%s: warning unknown frequency, defaulting to 800Mhz\n",
 43                         __func__);
 44         }
 45 
 46         return 800000000;
 47 }
 48 
 49 static inline unsigned long iop13xx_xsi_bus_ratio(void)
 50 {
 51         unsigned long  ratio = __raw_readl(IOP13XX_PROCESSOR_FREQ);
 52         ratio &= IOP13XX_XSI_FREQ_RATIO_MASK;
 53         switch (ratio) {
 54         case IOP13XX_XSI_FREQ_RATIO_2:
 55                 return 2;
 56         case IOP13XX_XSI_FREQ_RATIO_3:
 57                 return 3;
 58         case IOP13XX_XSI_FREQ_RATIO_4:
 59                 return 4;
 60         default:
 61                 printk("%s: warning unknown ratio, defaulting to 2\n",
 62                         __func__);
 63         }
 64 
 65         return 2;
 66 }
 67 
 68 static inline u32 read_tmr0(void)
 69 {
 70         u32 val;
 71         asm volatile("mrc p6, 0, %0, c0, c9, 0" : "=r" (val));
 72         return val;
 73 }
 74 
 75 static inline void write_tmr0(u32 val)
 76 {
 77         asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
 78 }
 79 
 80 static inline void write_tmr1(u32 val)
 81 {
 82         asm volatile("mcr p6, 0, %0, c1, c9, 0" : : "r" (val));
 83 }
 84 
 85 static inline u32 read_tcr0(void)
 86 {
 87         u32 val;
 88         asm volatile("mrc p6, 0, %0, c2, c9, 0" : "=r" (val));
 89         return val;
 90 }
 91 
 92 static inline void write_tcr0(u32 val)
 93 {
 94         asm volatile("mcr p6, 0, %0, c2, c9, 0" : : "r" (val));
 95 }
 96 
 97 static inline u32 read_tcr1(void)
 98 {
 99         u32 val;
100         asm volatile("mrc p6, 0, %0, c3, c9, 0" : "=r" (val));
101         return val;
102 }
103 
104 static inline void write_tcr1(u32 val)
105 {
106         asm volatile("mcr p6, 0, %0, c3, c9, 0" : : "r" (val));
107 }
108 
109 static inline void write_trr0(u32 val)
110 {
111         asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val));
112 }
113 
114 static inline void write_trr1(u32 val)
115 {
116         asm volatile("mcr p6, 0, %0, c5, c9, 0" : : "r" (val));
117 }
118 
119 static inline void write_tisr(u32 val)
120 {
121         asm volatile("mcr p6, 0, %0, c6, c9, 0" : : "r" (val));
122 }
123 #endif
124 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp