1 #include <linux/string.h>
2 #include <linux/kernel.h>
3 #include <linux/sched.h>
6 #include <asm/bootinfo.h>
7 #include <asm/macintosh.h>
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
)
35 while(*value
!='='&&*value
)
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
);
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;
102 void print_booter(char *env
)
110 while(*value
!='='&&*value
)
118 printk("%s=%s\n", name
,value
);