Linux-2.6.12-rc2
[linux-2.6/kvm.git] / arch / m68k / mac / bootparse.c
blob36d22360982387214adf2633bbaa83dfef040451
1 #include <linux/string.h>
2 #include <linux/kernel.h>
3 #include <linux/sched.h>
4 #include <asm/irq.h>
5 #include <asm/setup.h>
6 #include <asm/bootinfo.h>
7 #include <asm/macintosh.h>
9 /*
10 * Booter vars
13 int boothowto;
14 int _boothowto;
17 * Called early to parse the environment (passed to us from the booter)
18 * into a bootinfo struct. Will die as soon as we have our own booter
21 #define atol(x) simple_strtoul(x,NULL,0)
23 void parse_booter(char *env)
25 char *name;
26 char *value;
27 #if 0
28 while(0 && *env)
29 #else
30 while(*env)
31 #endif
33 name=env;
34 value=name;
35 while(*value!='='&&*value)
36 value++;
37 if(*value=='=')
38 *value++=0;
39 env=value;
40 while(*env)
41 env++;
42 env++;
43 #if 0
44 if(strcmp(name,"VIDEO_ADDR")==0)
45 mac_mch.videoaddr=atol(value);
46 if(strcmp(name,"ROW_BYTES")==0)
47 mac_mch.videorow=atol(value);
48 if(strcmp(name,"SCREEN_DEPTH")==0)
49 mac_mch.videodepth=atol(value);
50 if(strcmp(name,"DIMENSIONS")==0)
51 mac_mch.dimensions=atol(value);
52 #endif
53 if(strcmp(name,"BOOTTIME")==0)
54 mac_bi_data.boottime=atol(value);
55 if(strcmp(name,"GMTBIAS")==0)
56 mac_bi_data.gmtbias=atol(value);
57 if(strcmp(name,"BOOTERVER")==0)
58 mac_bi_data.bootver=atol(value);
59 if(strcmp(name,"MACOS_VIDEO")==0)
60 mac_bi_data.videological=atol(value);
61 if(strcmp(name,"MACOS_SCC")==0)
62 mac_bi_data.sccbase=atol(value);
63 if(strcmp(name,"MACHINEID")==0)
64 mac_bi_data.id=atol(value);
65 if(strcmp(name,"MEMSIZE")==0)
66 mac_bi_data.memsize=atol(value);
67 if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
68 mac_bi_data.serialmf=atol(value);
69 if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
70 mac_bi_data.serialhsk=atol(value);
71 if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
72 mac_bi_data.serialgpi=atol(value);
73 if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
74 mac_bi_data.printmf=atol(value);
75 if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
76 mac_bi_data.printhsk=atol(value);
77 if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
78 mac_bi_data.printgpi=atol(value);
79 if(strcmp(name,"PROCESSOR")==0)
80 mac_bi_data.cpuid=atol(value);
81 if(strcmp(name,"ROMBASE")==0)
82 mac_bi_data.rombase=atol(value);
83 if(strcmp(name,"TIMEDBRA")==0)
84 mac_bi_data.timedbra=atol(value);
85 if(strcmp(name,"ADBDELAY")==0)
86 mac_bi_data.adbdelay=atol(value);
88 #if 0 /* XXX: TODO with m68k_mach_* */
89 /* Fill in the base stuff */
90 boot_info.machtype=MACH_MAC;
91 /* Read this from the macinfo we got ! */
92 /* boot_info.cputype=CPU_68020|FPUB_68881;*/
93 /* boot_info.memory[0].addr=0;*/
94 /* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
95 boot_info.num_memory=1; /* On a MacII */
96 boot_info.ramdisk_size=0; /* For now */
97 *boot_info.command_line=0;
98 #endif
102 void print_booter(char *env)
104 char *name;
105 char *value;
106 while(*env)
108 name=env;
109 value=name;
110 while(*value!='='&&*value)
111 value++;
112 if(*value=='=')
113 *value++=0;
114 env=value;
115 while(*env)
116 env++;
117 env++;
118 printk("%s=%s\n", name,value);