Revision f7c70325 hw/realview.c
b/hw/realview.c | ||
---|---|---|
34 | 34 |
env->regs[15] = SMP_BOOT_ADDR; |
35 | 35 |
} |
36 | 36 |
|
37 |
/* The following two lists must be consistent. */ |
|
37 | 38 |
enum realview_board_type { |
38 | 39 |
BOARD_EB, |
39 | 40 |
BOARD_EB_MPCORE, |
40 |
BOARD_PB_A8 |
|
41 |
BOARD_PB_A8, |
|
42 |
BOARD_PBX_A9, |
|
43 |
}; |
|
44 |
|
|
45 |
int realview_board_id[] = { |
|
46 |
0x33b, |
|
47 |
0x33b, |
|
48 |
0x769, |
|
49 |
0x76d |
|
41 | 50 |
}; |
42 | 51 |
|
43 | 52 |
static void realview_init(ram_addr_t ram_size, |
... | ... | |
57 | 66 |
int n; |
58 | 67 |
int done_nic = 0; |
59 | 68 |
qemu_irq cpu_irq[4]; |
60 |
int is_mpcore = (board_type == BOARD_EB_MPCORE);
|
|
61 |
int is_pb = (board_type == BOARD_PB_A8);
|
|
69 |
int is_mpcore = 0;
|
|
70 |
int is_pb = 0;
|
|
62 | 71 |
uint32_t proc_id = 0; |
63 | 72 |
uint32_t sys_id; |
64 | 73 |
ram_addr_t low_ram_size; |
65 | 74 |
|
75 |
switch (board_type) { |
|
76 |
case BOARD_EB: |
|
77 |
break; |
|
78 |
case BOARD_EB_MPCORE: |
|
79 |
is_mpcore = 1; |
|
80 |
break; |
|
81 |
case BOARD_PB_A8: |
|
82 |
is_pb = 1; |
|
83 |
break; |
|
84 |
case BOARD_PBX_A9: |
|
85 |
is_mpcore = 1; |
|
86 |
is_pb = 1; |
|
87 |
break; |
|
88 |
} |
|
66 | 89 |
for (n = 0; n < smp_cpus; n++) { |
67 | 90 |
env = cpu_init(cpu_model); |
68 | 91 |
if (!env) { |
... | ... | |
76 | 99 |
} |
77 | 100 |
} |
78 | 101 |
if (arm_feature(env, ARM_FEATURE_V7)) { |
79 |
proc_id = 0x0e000000; |
|
102 |
if (is_mpcore) { |
|
103 |
proc_id = 0x0c000000; |
|
104 |
} else { |
|
105 |
proc_id = 0x0e000000; |
|
106 |
} |
|
80 | 107 |
} else if (arm_feature(env, ARM_FEATURE_V6K)) { |
81 | 108 |
proc_id = 0x06000000; |
82 | 109 |
} else if (arm_feature(env, ARM_FEATURE_V6)) { |
... | ... | |
104 | 131 |
arm_sysctl_init(0x10000000, sys_id, proc_id); |
105 | 132 |
|
106 | 133 |
if (is_mpcore) { |
107 |
dev = qdev_create(NULL, "realview_mpcore"); |
|
134 |
dev = qdev_create(NULL, is_pb ? "a9mpcore_priv": "realview_mpcore");
|
|
108 | 135 |
qdev_prop_set_uint32(dev, "num-cpu", smp_cpus); |
109 | 136 |
qdev_init_nofail(dev); |
110 | 137 |
busdev = sysbus_from_qdev(dev); |
138 |
if (is_pb) { |
|
139 |
realview_binfo.smp_priv_base = 0x1f000000; |
|
140 |
} else { |
|
141 |
realview_binfo.smp_priv_base = 0x10100000; |
|
142 |
} |
|
143 |
sysbus_mmio_map(busdev, 0, realview_binfo.smp_priv_base); |
|
111 | 144 |
for (n = 0; n < smp_cpus; n++) { |
112 | 145 |
sysbus_connect_irq(busdev, n, cpu_irq[n]); |
113 | 146 |
} |
... | ... | |
238 | 271 |
realview_binfo.kernel_cmdline = kernel_cmdline; |
239 | 272 |
realview_binfo.initrd_filename = initrd_filename; |
240 | 273 |
realview_binfo.nb_cpus = smp_cpus; |
241 |
realview_binfo.board_id = is_pb ? 0x769 : 0x33b;
|
|
274 |
realview_binfo.board_id = realview_board_id[board_type];
|
|
242 | 275 |
realview_binfo.loader_start = is_pb ? 0x70000000 : 0; |
243 | 276 |
arm_load_kernel(first_cpu, &realview_binfo); |
244 | 277 |
} |
... | ... | |
279 | 312 |
initrd_filename, cpu_model, BOARD_PB_A8); |
280 | 313 |
} |
281 | 314 |
|
315 |
static void realview_pbx_a9_init(ram_addr_t ram_size, |
|
316 |
const char *boot_device, |
|
317 |
const char *kernel_filename, const char *kernel_cmdline, |
|
318 |
const char *initrd_filename, const char *cpu_model) |
|
319 |
{ |
|
320 |
if (!cpu_model) { |
|
321 |
cpu_model = "cortex-a9"; |
|
322 |
} |
|
323 |
realview_init(ram_size, boot_device, kernel_filename, kernel_cmdline, |
|
324 |
initrd_filename, cpu_model, BOARD_PBX_A9); |
|
325 |
} |
|
326 |
|
|
282 | 327 |
static QEMUMachine realview_eb_machine = { |
283 | 328 |
.name = "realview-eb", |
284 | 329 |
.desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)", |
... | ... | |
298 | 343 |
.name = "realview-pb-a8", |
299 | 344 |
.desc = "ARM RealView Platform Baseboard for Cortex-A8", |
300 | 345 |
.init = realview_pb_a8_init, |
346 |
}; |
|
347 |
|
|
348 |
static QEMUMachine realview_pbx_a9_machine = { |
|
349 |
.name = "realview-pbx-a9", |
|
350 |
.desc = "ARM RealView Platform Baseboard Explore for Cortex-A9", |
|
351 |
.init = realview_pbx_a9_init, |
|
301 | 352 |
.use_scsi = 1, |
353 |
.max_cpus = 4, |
|
302 | 354 |
}; |
303 | 355 |
|
304 | 356 |
static void realview_machine_init(void) |
... | ... | |
306 | 358 |
qemu_register_machine(&realview_eb_machine); |
307 | 359 |
qemu_register_machine(&realview_eb_mpcore_machine); |
308 | 360 |
qemu_register_machine(&realview_pb_a8_machine); |
361 |
qemu_register_machine(&realview_pbx_a9_machine); |
|
309 | 362 |
} |
310 | 363 |
|
311 | 364 |
machine_init(realview_machine_init); |
Also available in: Unified diff