Annotation of funnyos/arch/testarm/config.c, Revision 1.1.1.1
1.1 init 1: /*
2: * $Id: config.c,v 1.1.1.1 2007/10/12 08:40:36 init Exp $
3: */
4: #include <sys/types.h>
5: #include <sys/device.h>
6:
7: /*
8: * Configuration file for platform (testarm).
9: */
10:
11: /* device drivers */
12: extern struct driver root_dr;
13: extern struct driver cpu_dr;
14:
15:
16: extern void(*putchar)(char);
17: void tacons_early_putc(char ch);
18:
19: /* amount of physical memory, in Bytes */
20: uint32_t physmem = 33554432;
21:
22: #if 0
23: /*
24: * Devices present in this system.
25: */
26: struct device devlist[] = {
27: /* name, minor, active, attach_subr, *devdata, locator, [*parent] */
28: /* 0 */ { "root", 0, 0, root_attach, NULL, 0 },
29: /* 1 */ { "cpu", 0, 0, cpu_attach, NULL, 0 },
30: /* 2 */ { "obio", 0, 0, obio_attach, NULL, 0 },
31: /* 3 */ { "tartc", 0, 0, tartc_attach, NULL, 0x15000000 },
32: /* 4 */ { "tacons", 0, 0, tacons_attach, NULL, 0x10000000 },
33: /* 5 */ { "fcons", 0, 0, fcons_attach, NULL, 0 },
34: { NULL, 0, 0, NULL, NULL, 0, NULL }
35: };
36:
37: void
38: devlist_prepare(void)
39: {
40: /*
41: * Where to attach each device.
42: * XXX kill this ugly macross.
43: */
44: ATTACH(0) AT PARENT(0);
45: ATTACH(1) AT PARENT(0);
46: ATTACH(2) AT PARENT(0);
47: ATTACH(3) AT PARENT(2);
48: ATTACH(4) AT PARENT(2);
49: ATTACH(5) AT PARENT(4);
50:
51: /*
52: * Early console putchar hack;
53: */
54: putchar = tacons_early_putc;
55:
56: };
57: /*
58: * How many instances of each device will be present in system.
59: * We need it to know (at compile-time) how many of struct xxx_dd (devdata) in device drivers
60: * should we compile. (sadly, we have no dynamic memory allocations subsystem for now)
61: */
62: /* this all is XXX; btw this've been moved in drivervar.h */
63: // #define NTACONS 1
64:
65: uint8_t ndevices = sizeof(devlist) / sizeof(struct device);
66: #endif /* not 0 */
67:
68: /*
69: * Where to attach each device.
70: */
71: struct attachinfo config_attachinfo[] = {
72: /* child, parent, pminor, loc, flags */
73: // { "obio", "root", 0, 0, 0 },
74: { "cpu" , "root", 0, 0, 0 },
75: // { "tacons", "obio", 0, 0x10000000, 0 },
76: // { "tartc", "obio", 0, 0x15000000, 0x01 },
77: // { "fcons", "tacons", 0, 0, 0},
78: { NULL, NULL, 0, 0, 0}
79: };
80:
81:
82: /*
83: * Link device names with their drivers.
84: */
85: struct driverinfo config_driverinfo[] = {
86: { "root", &root_dr, -1 },
87: // { "obio", &obio_dr, -1 },
88: { "cpu" , &cpu_dr, -1 },
89: // { "tacons", &tacons_dr, -1 },
90: // { "tartc", &tartc_dr, -1 },
91: // { "fcons", &fcons_dr, -1 },
92: { NULL, NULL, 0 }
93: };
94:
95:
96: /*
97: * Machine early-stage initialization hooks.
98: */
99:
100: void
101: config_consinit(void)
102: {
103: /*
104: * Configure putchar, so we can printf messages to the console without fcons.
105: */
106: /* putchar = tauart_early_putc; */
107: putchar = tacons_early_putc;
108: }
109:
110:
CVSweb