On Thu, 28 Dec 2017 22:31:36 -0800 Richard Henderson <richard.hender...@linaro.org> wrote:
> Now that we have the prerequisites in target/hppa/, > implement the hardware for a PA7100LC. > > This also enables build for hppa-softmmu. > > Signed-off-by: Helge Deller <del...@gmx.de> > [rth: Since it is all new code, squashed all branch development > withing hw/hppa/ to a single patch.] > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- [...] > diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c > index 4625e591ea..d491c2aeed 100644 > --- a/hw/hppa/machine.c > +++ b/hw/hppa/machine.c > @@ -1,5 +1,5 @@ > /* > - * QEMU HPPA hardware system emulator. > + * QEMU HP-PARISC (HPPA) hardware system emulator. > * Copyright 2017 Helge Deller <del...@gmx.de> > * > */ > @@ -17,12 +17,222 @@ > #include "hw/ide.h" > #include "hw/timer/i8254.h" > #include "hw/char/serial.h" > +#include "hw/hppa/hppa_sys.h" > #include "qemu/cutils.h" > #include "qapi/error.h" > > +#define MAX_IDE_BUS 2 > + > +static ISABus *hppa_isa_bus(void) > +{ > + ISABus *isa_bus; > + qemu_irq *isa_irqs; > + MemoryRegion *isa_region; > + > + isa_region = g_new(MemoryRegion, 1); > + memory_region_init_io(isa_region, NULL, &hppa_pci_ignore_ops, > + NULL, "isa-io", 0x800); > + memory_region_add_subregion(get_system_memory(), IDE_HPA, > + isa_region); > + > + isa_bus = isa_bus_new(NULL, get_system_memory(), isa_region, > + &error_abort); > + isa_irqs = i8259_init(isa_bus, > + /* qemu_allocate_irq(dino_set_isa_irq, s, 0)); */ > + NULL); > + isa_bus_irqs(isa_bus, isa_irqs); > + > + return isa_bus; > +} > + > +static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr) > +{ > + addr &= (0x10000000 - 1); > + return addr; > +} > > static void machine_hppa_init(MachineState *machine) > { > + ram_addr_t ram_size = machine->ram_size; > + const char *cpu_model > + = machine->cpu_model ? machine->cpu_model : "hppa1.1"; [...] > + > + /* Create 1 cpu (for now). */ > + cpu0 = HPPA_CPU(cpu_generic_init(TYPE_HPPA_CPU, cpu_model)); [...] Please don't use cpu_model in board code, use cpu_type instead. See 5daab28e as example