code clean up!
[my-code/arm.git] / betty / system.c
1 /*
2  * system.c - misc system specific stuff
3  *
4  * author: hackbard@hackdaworld.org
5  *
6  */
7
8 #include "system.h"
9
10 /*
11  * functions
12  */
13
14 void mmap_init(u8 memtype) {
15
16         MEMMAP=memtype;
17 }
18
19 void pll_init(void) {
20
21         /* configuration */
22         PLLCFG=0x42;    // multiplier = 3 (for cclk), dividor = 4 (for f_cco)
23         PLLCON=0x03;    // enable and set as clk source for the lpc
24
25         /* feed sequence */
26         PLLFEED=0xaa;
27         PLLFEED=0x55;
28
29         /* wait for lock */
30         while(!(PLLSTAT&(1<<10)))
31                 continue;
32 }
33
34 void pause(int cnt) {
35
36         while(cnt--)
37                 asm volatile ("nop");
38 }
39