Commit 727170b67105fef0e229e4b2eef45f88f121aa8c

Authored by Blue Swirl
1 parent 19a3da7f

Allow user to specify CPU model

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/ppc440.c
... ... @@ -34,7 +34,8 @@ static const unsigned int ppc440ep_sdram_bank_sizes[] = {
34 34 };
35 35  
36 36 CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
37   - const unsigned int pci_irq_nrs[4], int do_init)
  37 + const unsigned int pci_irq_nrs[4], int do_init,
  38 + const char *cpu_model)
38 39 {
39 40 target_phys_addr_t ram_bases[PPC440EP_SDRAM_NR_BANKS];
40 41 target_phys_addr_t ram_sizes[PPC440EP_SDRAM_NR_BANKS];
... ... @@ -44,13 +45,9 @@ CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
44 45 qemu_irq *irqs;
45 46 qemu_irq *pci_irqs;
46 47  
47   - env = cpu_ppc_init("440EP");
48   - if (!env && kvm_enabled()) {
49   - /* XXX Since qemu doesn't yet emulate 440, we just say it's a 405.
50   - * Since KVM doesn't use qemu's CPU emulation it seems to be working
51   - * OK. */
52   - env = cpu_ppc_init("405");
53   - }
  48 + if (cpu_model == NULL)
  49 + cpu_model = "405"; // XXX: should be 440EP
  50 + env = cpu_init(cpu_model);
54 51 if (!env) {
55 52 fprintf(stderr, "Unable to initialize CPU!\n");
56 53 exit(1);
... ...
hw/ppc440.h
... ... @@ -15,6 +15,7 @@
15 15 #include "hw.h"
16 16  
17 17 CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
18   - const unsigned int pci_irq_nrs[4], int do_init);
  18 + const unsigned int pci_irq_nrs[4], int do_init,
  19 + const char *cpu_model);
19 20  
20 21 #endif
... ...
hw/ppc440_bamboo.c
... ... @@ -103,7 +103,7 @@ static void bamboo_init(ram_addr_t ram_size,
103 103 int i;
104 104  
105 105 /* Setup CPU. */
106   - env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1);
  106 + env = ppc440ep_init(&ram_size, &pcibus, pci_irq_nrs, 1, cpu_model);
107 107  
108 108 if (pcibus) {
109 109 int unit_id = 0;
... ...