• Home
  • Raw
  • Download

Lines Matching +full:startup +full:- +full:time +full:- +full:ms

32 #include <asm/bootinfo-vme.h>
49 if (be16_to_cpu(bi->tag) == BI_VME_TYPE) in bvme6000_parse_bootinfo()
65 pit->pcddr |= 0x10; /* WDOG enable */ in bvme6000_reset()
77 * This function is called during kernel startup to initialize
116 pit->pgcr = 0x00; /* Unidirectional 8 bit, no handshake for now */ in config_bvme6000()
117 pit->psrr = 0x18; /* PIACK and PIRQ functions enabled */ in config_bvme6000()
118 pit->pacr = 0x00; /* Sub Mode 00, H2 i/p, no DMA */ in config_bvme6000()
119 pit->padr = 0x00; /* Just to be tidy! */ in config_bvme6000()
120 pit->paddr = 0x00; /* All inputs for now (safest) */ in config_bvme6000()
121 pit->pbcr = 0x80; /* Sub Mode 1x, H4 i/p, no DMA */ in config_bvme6000()
122 pit->pbdr = 0xbc | (*config_reg_ptr & BVME_CONFIG_SW1 ? 0 : 0x40); in config_bvme6000()
124 pit->pbddr = 0xf3; /* Mostly outputs */ in config_bvme6000()
125 pit->pcdr = 0x01; /* PA transceiver disabled */ in config_bvme6000()
126 pit->pcddr = 0x03; /* WDOG disable */ in config_bvme6000()
164 #define RTC_TIMER_COUNT ((RTC_TIMER_CYCLES / 2) - 1)
174 msr = rtc->msr & 0xc0; in bvme6000_timer_int()
175 rtc->msr = msr | 0x20; /* Ack the interrupt */ in bvme6000_timer_int()
185 * Set up the RTC timer 1 to mode 2, so T1 output toggles every 5ms
186 * (40000 x 125ns). It will interrupt every 10ms, when T1 goes low.
187 * So, when reading the elapsed time, you should read timer1,
189 * That gives you the number of 125ns ticks in to the 10ms period,
196 unsigned char msr = rtc->msr & 0xc0; in bvme6000_sched_init()
198 rtc->msr = 0; /* Ensure timer registers accessible */ in bvme6000_sched_init()
204 rtc->t1cr_omr = 0x04; /* Mode 2, ext clk */ in bvme6000_sched_init()
205 rtc->t1msb = RTC_TIMER_COUNT >> 8; in bvme6000_sched_init()
206 rtc->t1lsb = RTC_TIMER_COUNT & 0xff; in bvme6000_sched_init()
207 rtc->irr_icr1 &= 0xef; /* Route timer 1 to INTR pin */ in bvme6000_sched_init()
208 rtc->msr = 0x40; /* Access int.cntrl, etc */ in bvme6000_sched_init()
209 rtc->pfr_icr0 = 0x80; /* Just timer 1 ints enabled */ in bvme6000_sched_init()
210 rtc->irr_icr1 = 0; in bvme6000_sched_init()
211 rtc->t1cr_omr = 0x0a; /* INTR+T1 active lo, push-pull */ in bvme6000_sched_init()
212 rtc->t0cr_rtmr &= 0xdf; /* Stop timers in standby */ in bvme6000_sched_init()
213 rtc->msr = 0; /* Access timer 1 control */ in bvme6000_sched_init()
214 rtc->t1cr_omr = 0x05; /* Mode 2, ext clk, GO */ in bvme6000_sched_init()
216 rtc->msr = msr; in bvme6000_sched_init()
244 msr = rtc->msr & 0xc0; in bvme6000_read_clk()
245 rtc->msr = 0; /* Ensure timer registers accessible */ in bvme6000_read_clk()
249 t1int = rtc->msr & 0x20; in bvme6000_read_clk()
250 t1op = pit->pcdr & 0x04; in bvme6000_read_clk()
251 rtc->t1cr_omr |= 0x40; /* Latch timer1 */ in bvme6000_read_clk()
252 msb = rtc->t1msb; /* Read timer1 */ in bvme6000_read_clk()
253 v = (msb << 8) | rtc->t1lsb; /* Read timer1 */ in bvme6000_read_clk()
254 } while (t1int != (rtc->msr & 0x20) || in bvme6000_read_clk()
255 t1op != (pit->pcdr & 0x04) || in bvme6000_read_clk()
256 abs(ov-v) > 80 || in bvme6000_read_clk()
257 v > RTC_TIMER_COUNT - (RTC_TIMER_COUNT / 100)); in bvme6000_read_clk()
259 v = RTC_TIMER_COUNT - v; in bvme6000_read_clk()
264 rtc->msr = msr; in bvme6000_read_clk()
274 * Looks like op is non-zero for setting the clock, and zero for
284 * int wday; 0..6, 0 is Sunday, -1 means unknown/don't set
291 unsigned char msr = rtc->msr & 0xc0; in bvme6000_hwclk()
293 rtc->msr = 0x40; /* Ensure clock and real-time-mode-register in bvme6000_hwclk()
297 rtc->t0cr_rtmr = t->tm_year%4; in bvme6000_hwclk()
298 rtc->bcd_tenms = 0; in bvme6000_hwclk()
299 rtc->bcd_sec = bin2bcd(t->tm_sec); in bvme6000_hwclk()
300 rtc->bcd_min = bin2bcd(t->tm_min); in bvme6000_hwclk()
301 rtc->bcd_hr = bin2bcd(t->tm_hour); in bvme6000_hwclk()
302 rtc->bcd_dom = bin2bcd(t->tm_mday); in bvme6000_hwclk()
303 rtc->bcd_mth = bin2bcd(t->tm_mon + 1); in bvme6000_hwclk()
304 rtc->bcd_year = bin2bcd(t->tm_year%100); in bvme6000_hwclk()
305 if (t->tm_wday >= 0) in bvme6000_hwclk()
306 rtc->bcd_dow = bin2bcd(t->tm_wday+1); in bvme6000_hwclk()
307 rtc->t0cr_rtmr = t->tm_year%4 | 0x08; in bvme6000_hwclk()
312 t->tm_sec = bcd2bin(rtc->bcd_sec); in bvme6000_hwclk()
313 t->tm_min = bcd2bin(rtc->bcd_min); in bvme6000_hwclk()
314 t->tm_hour = bcd2bin(rtc->bcd_hr); in bvme6000_hwclk()
315 t->tm_mday = bcd2bin(rtc->bcd_dom); in bvme6000_hwclk()
316 t->tm_mon = bcd2bin(rtc->bcd_mth)-1; in bvme6000_hwclk()
317 t->tm_year = bcd2bin(rtc->bcd_year); in bvme6000_hwclk()
318 if (t->tm_year < 70) in bvme6000_hwclk()
319 t->tm_year += 100; in bvme6000_hwclk()
320 t->tm_wday = bcd2bin(rtc->bcd_dow)-1; in bvme6000_hwclk()
321 } while (t->tm_sec != bcd2bin(rtc->bcd_sec)); in bvme6000_hwclk()
324 rtc->msr = msr; in bvme6000_hwclk()