1
2
3
4
5
6
7
8
9
10
11
12
13#include <linux/init.h>
14#include <linux/mm.h>
15#include <linux/bootmem.h>
16#include <asm/pgtable.h>
17#include <linux/seq_file.h>
18#include <linux/screen_info.h>
19#include <linux/utsname.h>
20#include <linux/pfn.h>
21#include <linux/cpu.h>
22#include <asm/setup.h>
23
24
25
26
27struct screen_info screen_info;
28
29extern int root_mountflags;
30extern char _etext, _edata, _end;
31
32char __initdata cris_command_line[COMMAND_LINE_SIZE] = { 0, };
33
34extern const unsigned long text_start, edata;
35extern unsigned long dram_start, dram_end;
36
37extern unsigned long romfs_start, romfs_length, romfs_in_flash;
38
39static struct cpu cpu_devices[NR_CPUS];
40
41extern void show_etrax_copyright(void);
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59void __init setup_arch(char **cmdline_p)
60{
61 extern void init_etrax_debug(void);
62 unsigned long bootmap_size;
63 unsigned long start_pfn, max_pfn;
64 unsigned long memory_start;
65
66
67
68 init_etrax_debug();
69
70
71
72 high_memory = &dram_end;
73
74 if(romfs_in_flash || !romfs_length) {
75
76
77
78 memory_start = (unsigned long) &_end;
79 } else {
80
81 printk("ROM fs in RAM, size %lu bytes\n", romfs_length);
82 memory_start = romfs_start + romfs_length;
83 }
84
85
86
87 init_mm.start_code = (unsigned long) &text_start;
88 init_mm.end_code = (unsigned long) &_etext;
89 init_mm.end_data = (unsigned long) &_edata;
90 init_mm.brk = (unsigned long) &_end;
91
92
93
94
95
96
97
98
99
100
101
102 start_pfn = PFN_UP(memory_start);
103 max_pfn = PFN_DOWN((unsigned long)high_memory);
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 max_low_pfn = max_pfn;
122 min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT;
123
124 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
125 min_low_pfn,
126 max_low_pfn);
127
128
129
130 free_bootmem(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn - start_pfn));
131
132
133
134
135
136
137
138
139
140
141 reserve_bootmem(PFN_PHYS(start_pfn), bootmap_size, BOOTMEM_DEFAULT);
142
143
144
145 paging_init();
146
147 *cmdline_p = cris_command_line;
148
149#ifdef CONFIG_ETRAX_CMDLINE
150 if (!strcmp(cris_command_line, "")) {
151 strlcpy(cris_command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE);
152 cris_command_line[COMMAND_LINE_SIZE - 1] = '\0';
153 }
154#endif
155
156
157 memcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE);
158 boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
159
160
161 show_etrax_copyright();
162
163
164 strcpy(init_utsname()->machine, cris_machine_name);
165}
166
167static void *c_start(struct seq_file *m, loff_t *pos)
168{
169 return *pos < nr_cpu_ids ? (void *)(int)(*pos + 1) : NULL;
170}
171
172static void *c_next(struct seq_file *m, void *v, loff_t *pos)
173{
174 ++*pos;
175 return c_start(m, pos);
176}
177
178static void c_stop(struct seq_file *m, void *v)
179{
180}
181
182extern int show_cpuinfo(struct seq_file *m, void *v);
183
184const struct seq_operations cpuinfo_op = {
185 .start = c_start,
186 .next = c_next,
187 .stop = c_stop,
188 .show = show_cpuinfo,
189};
190
191static int __init topology_init(void)
192{
193 int i;
194
195 for_each_possible_cpu(i) {
196 return register_cpu(&cpu_devices[i], i);
197 }
198
199 return 0;
200}
201
202subsys_initcall(topology_init);
203
204