Revision dcac9679 hw/armv7m.c
b/hw/armv7m.c | ||
---|---|---|
170 | 170 |
#endif |
171 | 171 |
|
172 | 172 |
/* Flash programming is done via the SCU, so pretend it is ROM. */ |
173 |
cpu_register_physical_memory(0, flash_size, IO_MEM_ROM); |
|
173 |
cpu_register_physical_memory(0, flash_size, |
|
174 |
qemu_ram_alloc(flash_size) | IO_MEM_ROM); |
|
174 | 175 |
cpu_register_physical_memory(0x20000000, sram_size, |
175 |
flash_size + IO_MEM_RAM);
|
|
176 |
qemu_ram_alloc(sram_size) | IO_MEM_RAM);
|
|
176 | 177 |
armv7m_bitband_init(); |
177 | 178 |
|
178 | 179 |
pic = armv7m_nvic_init(env); |
179 | 180 |
|
180 | 181 |
image_size = load_elf(kernel_filename, 0, &entry, &lowaddr, NULL); |
181 | 182 |
if (image_size < 0) { |
182 |
image_size = load_image(kernel_filename, phys_ram_base);
|
|
183 |
image_size = load_image_targphys(kernel_filename, 0, flash_size);
|
|
183 | 184 |
lowaddr = 0; |
184 | 185 |
} |
185 | 186 |
if (image_size < 0) { |
... | ... | |
203 | 204 |
/* Hack to map an additional page of ram at the top of the address |
204 | 205 |
space. This stops qemu complaining about executing code outside RAM |
205 | 206 |
when returning from an exception. */ |
206 |
cpu_register_physical_memory(0xfffff000, 0x1000, IO_MEM_RAM + ram_size); |
|
207 |
cpu_register_physical_memory(0xfffff000, 0x1000, |
|
208 |
qemu_ram_alloc(0x1000) | IO_MEM_RAM); |
|
207 | 209 |
|
208 | 210 |
return pic; |
209 | 211 |
} |
Also available in: Unified diff