This source file includes following definitions.
- prom_init
1
2
3
4
5
6
7 #include <asm/openprom.h>
8 #include <asm/oplib.h>
9
10 struct linux_romvec *romvec;
11 enum prom_major_version prom_vers;
12 unsigned int prom_rev, prom_prev;
13
14
15 int prom_root_node;
16
17
18 struct linux_nodeops *prom_nodeops;
19
20
21
22
23
24
25 extern void prom_meminit(void);
26 extern void prom_ranges_init(void);
27
28 int
29 prom_init(struct linux_romvec *rp)
30 {
31 if(!rp) return 1;
32 romvec = rp;
33 if(romvec->pv_magic_cookie != LINUX_OPPROM_MAGIC)
34 return 1;
35
36
37 switch(romvec->pv_romvers) {
38 case 0:
39 prom_vers = PROM_V0;
40 break;
41 case 2:
42 prom_vers = PROM_V2;
43 break;
44 case 3:
45 prom_vers = PROM_V3;
46 break;
47 case 4:
48 prom_vers = PROM_P1275;
49 prom_printf("PROMLIB: Sun IEEE Prom not supported yet\n");
50 return 1;
51 break;
52 default:
53 prom_printf("PROMLIB: Bad PROM version %d\n",
54 romvec->pv_romvers);
55 return 1;
56 break;
57 };
58
59 prom_rev = romvec->pv_plugin_revision;
60 prom_prev = romvec->pv_printrev;
61 prom_nodeops = romvec->pv_nodeops;
62
63 prom_root_node = prom_getsibling(0);
64 if((prom_root_node == 0) || (prom_root_node == -1))
65 return 1;
66
67 if((((unsigned long) prom_nodeops) == 0) ||
68 (((unsigned long) prom_nodeops) == -1))
69 return 1;
70
71 prom_meminit();
72 prom_ranges_init();
73
74 prom_printf("PROMLIB: Sun Boot Prom Version %d Revision %d\n",
75 romvec->pv_romvers, prom_rev);
76
77
78 return 0;
79 }