void __init prom_meminit(u32 magic) { if (!prom_is_rex(magic)) pmax_setup_memory_region(); else rex_setup_memory_region(); }
void __init prom_init(void) { extern void ATTRIB_NORET dec_machine_halt(void); static char cpu_msg[] __initdata = "Sorry, this kernel is compiled for a wrong CPU type!\n"; s32 argc = fw_arg0; s32 *argv = (void *)fw_arg1; u32 magic = fw_arg2; s32 *prom_vec = (void *)fw_arg3; /* * Determine which PROM we have * (and therefore which machine we're on!) */ which_prom(magic, prom_vec); if (prom_is_rex(magic)) rex_clear_cache(); /* Register the early console. */ register_prom_console(); /* Were we compiled with the right CPU option? */ #if defined(CONFIG_CPU_R3000) if ((current_cpu_data.cputype == CPU_R4000SC) || (current_cpu_data.cputype == CPU_R4400SC)) { static char r4k_msg[] __initdata = "Please recompile with \"CONFIG_CPU_R4x00 = y\".\n"; printk(cpu_msg); printk(r4k_msg); dec_machine_halt(); } #endif #if defined(CONFIG_CPU_R4X00) if ((current_cpu_data.cputype == CPU_R3000) || (current_cpu_data.cputype == CPU_R3000A)) { static char r3k_msg[] __initdata = "Please recompile with \"CONFIG_CPU_R3000 = y\".\n"; printk(cpu_msg); printk(r3k_msg); dec_machine_halt(); } #endif prom_meminit(magic); prom_identify_arch(magic); prom_init_cmdline(argc, argv, magic); }
/* * Detect which PROM the DECSTATION has, and set the callback vectors * appropriately. */ void __init which_prom(s32 magic, s32 *prom_vec) { /* * No sign of the REX PROM's magic number means we assume a non-REX * machine (i.e. we're on a DS2100/3100, DS5100 or DS5000/2xx) */ if (prom_is_rex(magic)) { /* * Set up prom abstraction structure with REX entry points. */ __rex_bootinit = (void *)(long)*(prom_vec + REX_PROM_BOOTINIT); __rex_bootread = (void *)(long)*(prom_vec + REX_PROM_BOOTREAD); __rex_getbitmap = (void *)(long)*(prom_vec + REX_PROM_GETBITMAP); __prom_getchar = (void *)(long)*(prom_vec + REX_PROM_GETCHAR); __prom_getenv = (void *)(long)*(prom_vec + REX_PROM_GETENV); __rex_getsysid = (void *)(long)*(prom_vec + REX_PROM_GETSYSID); __rex_gettcinfo = (void *)(long)*(prom_vec + REX_PROM_GETTCINFO); __prom_printf = (void *)(long)*(prom_vec + REX_PROM_PRINTF); __rex_slot_address = (void *)(long)*(prom_vec + REX_PROM_SLOTADDR); __rex_clear_cache = (void *)(long)*(prom_vec + REX_PROM_CLEARCACHE); } else { /* * Set up prom abstraction structure with non-REX entry points. */ __prom_getchar = (void *)PMAX_PROM_GETCHAR; __prom_getenv = (void *)PMAX_PROM_GETENV; __prom_printf = (void *)PMAX_PROM_PRINTF; __pmax_open = (void *)PMAX_PROM_OPEN; __pmax_lseek = (void *)PMAX_PROM_LSEEK; __pmax_read = (void *)PMAX_PROM_READ; __pmax_close = (void *)PMAX_PROM_CLOSE; } }
int __init prom_init(s32 argc, s32 *argv, u32 magic, s32 *prom_vec) { extern void dec_machine_halt(void); /* * Determine which PROM's we have * (and therefore which machine we're on!) */ which_prom(magic, prom_vec); if (prom_is_rex(magic)) rex_clear_cache(); /* Were we compiled with the right CPU option? */ #if defined(CONFIG_CPU_R3000) if ((current_cpu_data.cputype == CPU_R4000SC) || (current_cpu_data.cputype == CPU_R4400SC)) { prom_printf("Sorry, this kernel is compiled for the wrong CPU type!\n"); prom_printf("Please recompile with \"CONFIG_CPU_R4x00 = y\"\n"); dec_machine_halt(); } #endif #if defined(CONFIG_CPU_R4X00) if ((current_cpu_data.cputype == CPU_R3000) || (current_cpu_data.cputype == CPU_R3000A)) { prom_printf("Sorry, this kernel is compiled for the wrong CPU type!\n"); prom_printf("Please recompile with \"CONFIG_CPU_R3000 = y\"\n"); dec_machine_halt(); } #endif prom_meminit(magic); prom_identify_arch(magic); prom_init_cmdline(argc, argv, magic); return 0; }
void __init prom_init_cmdline(s32 argc, s32 *argv, u32 magic) { char *arg; int start_arg, i; /* * collect args and prepare cmd_line */ if (!prom_is_rex(magic)) start_arg = 1; else start_arg = 2; for (i = start_arg; i < argc; i++) { arg = (void *)(long)(argv[i]); strcat(arcs_cmdline, arg); if (i < (argc - 1)) strcat(arcs_cmdline, " "); } #ifdef PROM_DEBUG printk("arcs_cmdline: %s\n", &(arcs_cmdline[0])); #endif }
void __init prom_identify_arch(u32 magic) { unsigned char dec_cpunum, dec_firmrev, dec_etc, dec_systype; u32 dec_sysid; if (!prom_is_rex(magic)) { dec_sysid = simple_strtoul(prom_getenv("systype"), (char **)0, 0); } else { dec_sysid = rex_getsysid(); if (dec_sysid == 0) { printk("Zero sysid returned from PROM! " "Assuming a PMAX-like machine.\n"); dec_sysid = 1; } } dec_cpunum = (dec_sysid & 0xff000000) >> 24; dec_systype = (dec_sysid & 0xff0000) >> 16; dec_firmrev = (dec_sysid & 0xff00) >> 8; dec_etc = dec_sysid & 0xff; /* * FIXME: This may not be an exhaustive list of DECStations/Servers! * Put all model-specific initialisation calls here. */ switch (dec_systype) { case DS2100_3100: mips_machtype = MACH_DS23100; prom_init_kn01(); break; case DS5100: /* DS5100 MIPSMATE */ mips_machtype = MACH_DS5100; prom_init_kn230(); break; case DS5000_200: /* DS5000 3max */ mips_machtype = MACH_DS5000_200; prom_init_kn02(); break; case DS5000_1XX: /* DS5000/100 3min */ mips_machtype = MACH_DS5000_1XX; prom_init_kn02xa(); break; case DS5000_2X0: /* DS5000/240 3max+ or DS5900 bigmax */ mips_machtype = MACH_DS5000_2X0; prom_init_kn03(); if (!(ioasic_read(IO_REG_SIR) & KN03_IO_INR_3MAXP)) mips_machtype = MACH_DS5900; break; case DS5000_XX: /* Personal DS5000/xx maxine */ mips_machtype = MACH_DS5000_XX; prom_init_kn02xa(); break; case DS5800: /* DS5800 Isis */ mips_machtype = MACH_DS5800; break; case DS5400: /* DS5400 MIPSfair */ mips_machtype = MACH_DS5400; break; case DS5500: /* DS5500 MIPSfair-2 */ mips_machtype = MACH_DS5500; break; default: mips_machtype = MACH_DSUNKNOWN; break; } if (mips_machtype == MACH_DSUNKNOWN) printk("This is an %s, id is %x\n", dec_system_strings[mips_machtype], dec_systype); else printk("This is a %s\n", dec_system_strings[mips_machtype]); }