void prom_init(struct linux_romvec *rp) { romvec = rp; #if CONFIG_AP1000 prom_vers = PROM_AP1000; prom_meminit(); prom_ranges_init(); return; #endif switch(romvec->pv_romvers) { case 0: prom_vers = PROM_V0; break; case 2: prom_vers = PROM_V2; break; case 3: prom_vers = PROM_V3; break; case 4: prom_vers = PROM_P1275; prom_printf("PROMLIB: Sun IEEE Prom not supported yet\n"); prom_halt(); break; default: prom_printf("PROMLIB: Bad PROM version %d\n", romvec->pv_romvers); prom_halt(); break; }; prom_rev = romvec->pv_plugin_revision; prom_prev = romvec->pv_printrev; prom_nodeops = romvec->pv_nodeops; prom_root_node = prom_getsibling(0); if((prom_root_node == 0) || (prom_root_node == -1)) prom_halt(); if((((unsigned long) prom_nodeops) == 0) || (((unsigned long) prom_nodeops) == -1)) prom_halt(); prom_meminit(); prom_ranges_init(); printk("PROMLIB: Sun Boot Prom Version %d Revision %d\n", romvec->pv_romvers, prom_rev); /* Initialization successful. */ return; }
__initfunc(void prom_init(void *cif_handler, void *cif_stack)) { char buffer[80], *p; int ints[3]; int node; int i = 0; prom_vers = PROM_P1275; prom_cif_init(cif_handler, cif_stack); prom_root_node = prom_getsibling(0); if((prom_root_node == 0) || (prom_root_node == -1)) prom_halt(); prom_chosen_node = prom_finddevice("/chosen"); if (!prom_chosen_node || prom_chosen_node == -1) prom_halt(); prom_stdin = prom_getint (prom_chosen_node, "stdin"); prom_stdout = prom_getint (prom_chosen_node, "stdout"); node = prom_finddevice("/openprom"); if (!node || node == -1) prom_halt(); prom_getstring (node, "version", buffer, sizeof (buffer)); prom_printf ("\n"); if (strncmp (buffer, "OBP ", 4)) goto strange_version; /* Version field is expected to be 'OBP xx.yy.zz date...' */ p = buffer + 4; while (p && isdigit(*p) && i < 3) { ints[i++] = simple_strtoul(p, NULL, 0); if ((p = strchr(p, '.')) != NULL) p++; } if (i != 3) goto strange_version; prom_rev = ints[1]; prom_prev = (ints[0] << 16) | (ints[1] << 8) | ints[2]; printk ("PROMLIB: Sun IEEE Boot Prom %s\n", buffer + 4); prom_meminit(); prom_ranges_init(); /* Initialization successful. */ return; strange_version: prom_printf ("Strange OBP version `%s'.\n", buffer); prom_halt (); }
void __init prom_init(struct linux_romvec *rp) { #ifdef CONFIG_SUN4 extern struct linux_romvec *sun4_prom_init(void); rp = sun4_prom_init(); #endif romvec = rp; switch(romvec->pv_romvers) { case 0: prom_vers = PROM_V0; break; case 2: prom_vers = PROM_V2; break; case 3: prom_vers = PROM_V3; break; case 40: prom_vers = PROM_SUN4; break; default: prom_printf("PROMLIB: Bad PROM version %d\n", romvec->pv_romvers); prom_halt(); break; }; prom_rev = romvec->pv_plugin_revision; prom_prev = romvec->pv_printrev; prom_nodeops = romvec->pv_nodeops; prom_root_node = prom_getsibling(0); if((prom_root_node == 0) || (prom_root_node == -1)) prom_halt(); if((((unsigned long) prom_nodeops) == 0) || (((unsigned long) prom_nodeops) == -1)) prom_halt(); if(prom_vers == PROM_V2 || prom_vers == PROM_V3) { prom_stdout = *romvec->pv_v2bootargs.fd_stdout; prom_stdin = *romvec->pv_v2bootargs.fd_stdin; } prom_meminit(); prom_ranges_init(); #ifndef CONFIG_SUN4 /* SUN4 prints this in sun4_prom_init */ printk("PROMLIB: Sun Boot Prom Version %d Revision %d\n", romvec->pv_romvers, prom_rev); #endif /* Initialization successful. */ return; }
void __init prom_init(struct linux_romvec *rp) { romvec = rp; switch(romvec->pv_romvers) { case 0: prom_vers = PROM_V0; break; case 2: prom_vers = PROM_V2; break; case 3: prom_vers = PROM_V3; break; default: prom_printf("PROMLIB: Bad PROM version %d\n", romvec->pv_romvers); prom_halt(); break; }; prom_rev = romvec->pv_plugin_revision; prom_prev = romvec->pv_printrev; prom_nodeops = romvec->pv_nodeops; prom_root_node = prom_getsibling(0); if((prom_root_node == 0) || (prom_root_node == -1)) prom_halt(); if((((unsigned long) prom_nodeops) == 0) || (((unsigned long) prom_nodeops) == -1)) prom_halt(); prom_meminit(); prom_ranges_init(); printk("PROMLIB: Sun Boot Prom Version %d Revision %d\n", romvec->pv_romvers, prom_rev); /* Initialization successful. */ }