Revision c68ea704 hw/ppc_prep.c
b/hw/ppc_prep.c | ||
---|---|---|
99 | 99 |
static void pic_irq_request(void *opaque, int level) |
100 | 100 |
{ |
101 | 101 |
if (level) |
102 |
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
|
|
102 |
cpu_interrupt(first_cpu, CPU_INTERRUPT_HARD);
|
|
103 | 103 |
else |
104 |
cpu_reset_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
|
|
104 |
cpu_reset_interrupt(first_cpu, CPU_INTERRUPT_HARD);
|
|
105 | 105 |
} |
106 | 106 |
|
107 | 107 |
/* PCI intack register */ |
... | ... | |
294 | 294 |
/* Special port 92 */ |
295 | 295 |
/* Check soft reset asked */ |
296 | 296 |
if (val & 0x01) { |
297 |
// cpu_interrupt(cpu_single_env, CPU_INTERRUPT_RESET);
|
|
297 |
// cpu_interrupt(first_cpu, CPU_INTERRUPT_RESET);
|
|
298 | 298 |
} |
299 | 299 |
/* Check LE mode */ |
300 | 300 |
if (val & 0x02) { |
... | ... | |
331 | 331 |
break; |
332 | 332 |
case 0x0814: |
333 | 333 |
/* L2 invalidate register */ |
334 |
// tlb_flush(cpu_single_env, 1);
|
|
334 |
// tlb_flush(first_cpu, 1);
|
|
335 | 335 |
break; |
336 | 336 |
case 0x081C: |
337 | 337 |
/* system control register */ |
... | ... | |
523 | 523 |
const char *kernel_filename, const char *kernel_cmdline, |
524 | 524 |
const char *initrd_filename) |
525 | 525 |
{ |
526 |
CPUState *env; |
|
526 | 527 |
char buf[1024]; |
527 | 528 |
m48t59_t *nvram; |
528 | 529 |
int PPC_io_memory; |
... | ... | |
537 | 538 |
return; |
538 | 539 |
|
539 | 540 |
linux_boot = (kernel_filename != NULL); |
541 |
|
|
542 |
/* init CPUs */ |
|
543 |
|
|
544 |
env = cpu_init(); |
|
545 |
register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); |
|
546 |
|
|
547 |
/* Register CPU as a 604 */ |
|
548 |
/* XXX: CPU model (or PVR) should be provided on command line */ |
|
549 |
// ppc_find_by_name("604r", &def); |
|
550 |
// ppc_find_by_name("604e", &def); |
|
551 |
ppc_find_by_name("604", &def); |
|
552 |
if (def == NULL) { |
|
553 |
cpu_abort(env, "Unable to find PowerPC CPU definition\n"); |
|
554 |
} |
|
555 |
cpu_ppc_register(env, def); |
|
556 |
/* Set time-base frequency to 100 Mhz */ |
|
557 |
cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL); |
|
540 | 558 |
|
541 | 559 |
/* allocate RAM */ |
542 | 560 |
cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); |
... | ... | |
584 | 602 |
initrd_size = 0; |
585 | 603 |
} |
586 | 604 |
|
587 |
/* Register CPU as a 604 */ |
|
588 |
/* XXX: CPU model (or PVR) should be provided on command line */ |
|
589 |
// ppc_find_by_name("604r", &def); |
|
590 |
// ppc_find_by_name("604e", &def); |
|
591 |
ppc_find_by_name("604", &def); |
|
592 |
if (def == NULL) { |
|
593 |
cpu_abort(cpu_single_env, "Unable to find PowerPC CPU definition\n"); |
|
594 |
} |
|
595 |
cpu_ppc_register(cpu_single_env, def); |
|
596 |
/* Set time-base frequency to 100 Mhz */ |
|
597 |
cpu_ppc_tb_init(cpu_single_env, 100UL * 1000UL * 1000UL); |
|
598 |
|
|
599 | 605 |
isa_mem_base = 0xc0000000; |
600 | 606 |
pci_bus = pci_prep_init(); |
601 | 607 |
// pci_bus = i440fx_init(); |
... | ... | |
609 | 615 |
vga_ram_size, 0, 0); |
610 | 616 |
rtc_init(0x70, 8); |
611 | 617 |
// openpic = openpic_init(0x00000000, 0xF0000000, 1); |
612 |
isa_pic = pic_init(pic_irq_request, cpu_single_env);
|
|
618 |
isa_pic = pic_init(pic_irq_request, first_cpu);
|
|
613 | 619 |
// pit = pit_init(0x40, 0); |
614 | 620 |
|
615 | 621 |
serial_init(0x3f8, 4, serial_hds[0]); |
Also available in: Unified diff