Annotation of funnyos/arch/sam7s64/config.c, Revision 1.4
1.1 init 1: /*
1.4 ! nbrk 2: * $Id: config.c,v 1.3 2007/11/09 16:12:15 init Exp $
1.1 init 3: */
4: #include <sys/types.h>
5: #include <sys/device.h>
6:
1.4 ! nbrk 7: /* devices' regs that we will touch in config_machineinit() */
! 8: #include <arch/sam7s64/dev/sapmcreg.h>
! 9:
1.1 init 10: /*
11: * Configuration file for platform (AT91SAM7S64).
12: */
13:
14: /* device drivers */
15: extern struct driver root_dr;
16: extern struct driver cpu_dr;
1.3 init 17: extern struct driver saapbus_dr;
1.1 init 18:
19:
20: extern void(*putchar)(char);
1.2 init 21: void sauart_early_putc(char ch);
1.1 init 22:
23: /* amount of physical memory, in Bytes */
1.2 init 24: uint32_t physmem = 16384;
1.1 init 25:
26: /*
27: * Where to attach each device.
28: */
29: struct attachinfo config_attachinfo[] = {
30: /* child, parent, pminor, loc, intrno, flags */
31: { "cpu" , "root", 0, 0, 0, 0 },
1.3 init 32: { "saapbus","root", 0, 0, 0, 0 },
1.1 init 33: { NULL, NULL, 0, 0, 0, 0 }
34: };
35:
36:
37: /*
38: * Link device names with their drivers.
39: */
40: struct driverinfo config_driverinfo[] = {
41: /* name, driverp, ninstances (should be -1) */
42: { "root", &root_dr, -1 },
43: { "cpu" , &cpu_dr, -1 },
1.3 init 44: { "saapbus" , &saapbus_dr, -1 },
1.1 init 45: { NULL, NULL, 0 }
46: };
47:
48:
49: /*
50: * Machine early-stage initialization hooks.
51: */
52:
53: void
1.4 ! nbrk 54: config_machineinit(void)
1.1 init 55: {
56: /*
1.4 ! nbrk 57: * Initialize critical devices at startup.
1.1 init 58: */
1.4 ! nbrk 59:
! 60: /* XXX kill magic */
! 61:
! 62: /* enable main oscillator and set 6 Slow Clock cycles to wait for its startup */
! 63: *(uint32_t)(SAPMC_BASE + SAPMC_CKGR_MOR) = (0x0000ff00 & (0x06 << 8)) | 0x00000001;
! 64:
! 65: /* wait main osc. to stabilize.. */
! 66: while (*(uint32_t)(SAPMC_BASE + SAPMC_PMC_SR) & 0x00000001 )
! 67: ;
! 68:
! 69: /* TODO set PLL */
! 70: // *(uint32_t)(SAPMC_BASE + SAPMC_PMC_MCKR) =
1.1 init 71: }
72:
73:
CVSweb