setup.c (8dd06ef34b6e2f41b29fbf5fc1663780f2524285) setup.c (7f7bc20bc41a4fbcd2db75b375ac95e5faf958ae)
1/*
2 * Nios2-specific parts of system setup
3 *
4 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
5 * Copyright (C) 2004 Microtronix Datacom Ltd.
6 * Copyright (C) 2001 Vic Phillips <vic@microtronix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 18 unchanged lines hidden (view full) ---

27#include <asm/cpuinfo.h>
28
29unsigned long memory_start;
30EXPORT_SYMBOL(memory_start);
31
32unsigned long memory_end;
33EXPORT_SYMBOL(memory_end);
34
1/*
2 * Nios2-specific parts of system setup
3 *
4 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
5 * Copyright (C) 2004 Microtronix Datacom Ltd.
6 * Copyright (C) 2001 Vic Phillips <vic@microtronix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 18 unchanged lines hidden (view full) ---

27#include <asm/cpuinfo.h>
28
29unsigned long memory_start;
30EXPORT_SYMBOL(memory_start);
31
32unsigned long memory_end;
33EXPORT_SYMBOL(memory_end);
34
35unsigned long memory_size;
36
37static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38 0, 0, 0, 0, 0, 0,
39 0};
40
41#ifdef CONFIG_VT
42struct screen_info screen_info;
43#endif
44

--- 91 unchanged lines hidden (view full) ---

136 else
137 strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
138#endif
139#endif
140
141 parse_early_param();
142}
143
35static struct pt_regs fake_regs = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
36 0, 0, 0, 0, 0, 0,
37 0};
38
39#ifdef CONFIG_VT
40struct screen_info screen_info;
41#endif
42

--- 91 unchanged lines hidden (view full) ---

134 else
135 strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
136#endif
137#endif
138
139 parse_early_param();
140}
141
142static void __init find_limits(unsigned long *min, unsigned long *max_low,
143 unsigned long *max_high)
144{
145 *max_low = PFN_DOWN(memblock_get_current_limit());
146 *min = PFN_UP(memblock_start_of_DRAM());
147 *max_high = PFN_DOWN(memblock_end_of_DRAM());
148}
149
144void __init setup_arch(char **cmdline_p)
145{
146 int dram_start;
147
148 console_verbose();
149
150void __init setup_arch(char **cmdline_p)
151{
152 int dram_start;
153
154 console_verbose();
155
150 dram_start = memblock_start_of_DRAM();
151 memory_size = memblock_phys_mem_size();
152 memory_start = PAGE_ALIGN((unsigned long)__pa(_end));
153 memory_end = (unsigned long) CONFIG_NIOS2_MEM_BASE + memory_size;
156 memory_start = memblock_start_of_DRAM();
157 memory_end = memblock_end_of_DRAM();
154
155 init_mm.start_code = (unsigned long) _stext;
156 init_mm.end_code = (unsigned long) _etext;
157 init_mm.end_data = (unsigned long) _edata;
158 init_mm.brk = (unsigned long) _end;
159 init_task.thread.kregs = &fake_regs;
160
161 /* Keep a copy of command line */
162 *cmdline_p = boot_command_line;
163
158
159 init_mm.start_code = (unsigned long) _stext;
160 init_mm.end_code = (unsigned long) _etext;
161 init_mm.end_data = (unsigned long) _edata;
162 init_mm.brk = (unsigned long) _end;
163 init_task.thread.kregs = &fake_regs;
164
165 /* Keep a copy of command line */
166 *cmdline_p = boot_command_line;
167
164 min_low_pfn = PFN_UP(memory_start);
165 max_low_pfn = PFN_DOWN(memory_end);
168 find_limits(&min_low_pfn, &max_low_pfn, &max_pfn);
166 max_mapnr = max_low_pfn;
167
169 max_mapnr = max_low_pfn;
170
168 memblock_reserve(dram_start, memory_start - dram_start);
171 memblock_reserve(__pa_symbol(_stext), _end - _stext);
169#ifdef CONFIG_BLK_DEV_INITRD
170 if (initrd_start) {
171 memblock_reserve(virt_to_phys((void *)initrd_start),
172 initrd_end - initrd_start);
173 }
174#endif /* CONFIG_BLK_DEV_INITRD */
175
176 early_init_fdt_reserve_self();

--- 23 unchanged lines hidden ---
172#ifdef CONFIG_BLK_DEV_INITRD
173 if (initrd_start) {
174 memblock_reserve(virt_to_phys((void *)initrd_start),
175 initrd_end - initrd_start);
176 }
177#endif /* CONFIG_BLK_DEV_INITRD */
178
179 early_init_fdt_reserve_self();

--- 23 unchanged lines hidden ---