diff options
Diffstat (limited to 'Documentation/mips/time.README')
-rw-r--r-- | Documentation/mips/time.README | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/Documentation/mips/time.README b/Documentation/mips/time.README index e1304b6bc483..a4ce603ed3b3 100644 --- a/Documentation/mips/time.README +++ b/Documentation/mips/time.README | |||
@@ -38,19 +38,14 @@ The new time code provide the following services: | |||
38 | 38 | ||
39 | a) Implements functions required by Linux common code: | 39 | a) Implements functions required by Linux common code: |
40 | time_init | 40 | time_init |
41 | do_gettimeofday | ||
42 | do_settimeofday | ||
43 | 41 | ||
44 | b) provides an abstraction of RTC and null RTC implementation as default. | 42 | b) provides an abstraction of RTC and null RTC implementation as default. |
45 | extern unsigned long (*rtc_get_time)(void); | 43 | extern unsigned long (*rtc_get_time)(void); |
46 | extern int (*rtc_set_time)(unsigned long); | 44 | extern int (*rtc_set_time)(unsigned long); |
47 | 45 | ||
48 | c) a set of gettimeoffset functions for different CPUs and different | 46 | c) high-level and low-level timer interrupt routines where the timer |
49 | needs. | 47 | interrupt source may or may not be the CPU timer. The high-level |
50 | 48 | routine is dispatched through do_IRQ() while the low-level is | |
51 | d) high-level and low-level timer interrupt routines where the timer | ||
52 | interrupt source may or may not be the CPU timer. The high-level | ||
53 | routine is dispatched through do_IRQ() while the low-level is | ||
54 | dispatched in assemably code (usually int-handler.S) | 49 | dispatched in assemably code (usually int-handler.S) |
55 | 50 | ||
56 | 51 | ||
@@ -73,8 +68,7 @@ the following functions or values: | |||
73 | c) (optional) board-specific RTC routines. | 68 | c) (optional) board-specific RTC routines. |
74 | 69 | ||
75 | d) (optional) mips_hpt_frequency - It must be definied if the board | 70 | d) (optional) mips_hpt_frequency - It must be definied if the board |
76 | is using CPU counter for timer interrupt or it is using fixed rate | 71 | is using CPU counter for timer interrupt. |
77 | gettimeoffset(). | ||
78 | 72 | ||
79 | 73 | ||
80 | PORTING GUIDE | 74 | PORTING GUIDE |
@@ -89,16 +83,6 @@ Step 1: decide how you like to implement the time services. | |||
89 | If the answer is no, you need a timer to provide the timer interrupt | 83 | If the answer is no, you need a timer to provide the timer interrupt |
90 | at 100 HZ speed. | 84 | at 100 HZ speed. |
91 | 85 | ||
92 | You cannot use the fast gettimeoffset functions, i.e., | ||
93 | |||
94 | unsigned long fixed_rate_gettimeoffset(void); | ||
95 | unsigned long calibrate_div32_gettimeoffset(void); | ||
96 | unsigned long calibrate_div64_gettimeoffset(void); | ||
97 | |||
98 | You can use null_gettimeoffset() will gives the same time resolution as | ||
99 | jiffy. Or you can implement your own gettimeoffset (probably based on | ||
100 | some ad hoc hardware on your machine.) | ||
101 | |||
102 | c) The following sub steps assume your CPU has counter register. | 86 | c) The following sub steps assume your CPU has counter register. |
103 | Do you plan to use the CPU counter register as the timer interrupt | 87 | Do you plan to use the CPU counter register as the timer interrupt |
104 | or use an exnternal timer? | 88 | or use an exnternal timer? |
@@ -123,8 +107,8 @@ Step 3: implement rtc routines, board_time_init() and plat_timer_setup() | |||
123 | board_time_init() - | 107 | board_time_init() - |
124 | a) (optional) set up RTC routines, | 108 | a) (optional) set up RTC routines, |
125 | b) (optional) calibrate and set the mips_hpt_frequency | 109 | b) (optional) calibrate and set the mips_hpt_frequency |
126 | (only needed if you intended to use fixed_rate_gettimeoffset | 110 | (only needed if you intended to use cpu counter as timer interrupt |
127 | or use cpu counter as timer interrupt source) | 111 | source) |
128 | 112 | ||
129 | plat_timer_setup() - | 113 | plat_timer_setup() - |
130 | a) (optional) over-write any choices made above by time_init(). | 114 | a) (optional) over-write any choices made above by time_init(). |
@@ -154,8 +138,8 @@ for some of the functions in time.c. | |||
154 | For example, you may define your own timer interrupt routine, which does | 138 | For example, you may define your own timer interrupt routine, which does |
155 | some of its own processing and then calls timer_interrupt(). | 139 | some of its own processing and then calls timer_interrupt(). |
156 | 140 | ||
157 | You can also over-ride any of the built-in functions (gettimeoffset, | 141 | You can also over-ride any of the built-in functions (RTC routines |
158 | RTC routines and/or timer interrupt routine). | 142 | and/or timer interrupt routine). |
159 | 143 | ||
160 | 144 | ||
161 | PORTING NOTES FOR SMP | 145 | PORTING NOTES FOR SMP |
@@ -187,10 +171,3 @@ You need to decide on your timer interrupt sources. | |||
187 | 171 | ||
188 | You can also do the low-level version of those interrupt routines, | 172 | You can also do the low-level version of those interrupt routines, |
189 | following similar dispatching routes described above. | 173 | following similar dispatching routes described above. |
190 | |||
191 | Note about do_gettimeoffset(): | ||
192 | |||
193 | It is very likely the CPU counter registers are not sync'ed up in a SMP box. | ||
194 | Therefore you cannot really use the many of the existing routines that | ||
195 | are based on CPU counter. You should wirte your own gettimeoffset rouinte | ||
196 | if you want intra-jiffy resolution. | ||