aboutsummaryrefslogtreecommitdiff
path: root/hw/ppce500_mpc8544ds.c
AgeCommit message (Collapse)Author
2012-08-15PPC: e500: rename mpc8544ds into generic fileScott Wood
Rename the file (with no changes other than fixing up the header paths) in preparation for refactoring into a generic e500 platform. Also move it into the newly created ppc/ directory. Signed-off-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Andreas Färber <afaerber@suse.de> [agraf: conditionalize on CONFIG_FDT] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: BookE: Implement EPR SPRAlexander Graf
On the e500 series, accessing SPR_EPR magically turns into an access at that CPU's IACK register on the MPIC. Implement that logic to get kernels that make use of that feature work. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: allow users to set the /compatible property via -machineAlexander Graf
Device trees usually have a node /compatible, which indicate which machine type we're looking at. For quick prototyping, it can be very useful to change the contents of that node via the command line. Thus, introduce a new option to -machine called dt_compatible, which when set changes the /compatible contents to its value. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: Refactor serial dt generationAlexander Graf
When generating serial port device tree nodes, we duplicate quite a bit of code, because there are 2 of them in the mpc8544ds board we emulate. Shove the generating code into a function, so we duplicate less code. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: Extend address/size of / to 64bitAlexander Graf
We want to be able to support >= 4GB of RAM. To do so, we need to be able to tell the guest OS how much RAM it has. However, that information today is capped to 32bit. So let's extend the offset and size fields to 64bit, so we can fit in big addresses and even one day - if we wish to do so - map devices above 32bit. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: Define addresses as always 64bitAlexander Graf
Every time we use an address constant, it needs to potentially fit into a 64bit physical address space. So let's define things accordingly. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: Use new SOC dt formatAlexander Graf
Due to popular demand, let's clean up the soc node a bit and use more recent dt notions. Requested-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: Use new MPIC dt formatAlexander Graf
Due to popular demand, we're updating the way we generate the MPIC node and interrupt lines based on what the current state of art is. Requested-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: enable manual loading of dtb blobAlexander Graf
We want to be able to override the automatically created device tree by using the -dtb option. Implement this for the mpc8544ds machine. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: use target_phys_addr_t for ramsizeAlexander Graf
We're passing the ram size as uint32_t, capping it to 32 bits atm. Change to target_phys_addr_t (uint64_t) to make sure we have all the bits. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: use 64bit cell helperAlexander Graf
We have a nice 64bit helper to ease the device tree generation and make the code more readable when creating 64bit 2-cell parameters. Use it when generating the device tree. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24dt: Add -machine dumpdtb option to dump the current dtbAlexander Graf
Now that we are dynamically creating the dtb, it's really useful to be able to dump the created blob for debugging. This patch implements a -machine dumpdtb=<file> option for e500 that dumps the dtb exactly in the form the guest would get it to disk. It can then be analyzed by dtc to get information about the guest configuration. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: start with empty device treeAlexander Graf
Now that all of the device tree bits are generated during runtime, we can get rid of the device tree blob and instead start from scratch with an empty device tree. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create pci node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create global-utils node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create mpic node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create serial nodes dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create /soc8544 node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create /chosen node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create / node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create /hypervisor node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create /cpus node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: dt: create memory node dynamicallyAlexander Graf
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: e500: require libfdtAlexander Graf
Now that we're moving all of the device tree generation from an external pre-execution generated blob to runtime generation using libfdt, we absolutely must have libfdt around. This requirement was there before already, as the only way to not require libfdt with e500 was to not use -kernel, which was the only way to boot the mpc8544ds machine. This patch only manifests said requirement in the build system. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-24PPC: mpc8544ds: Span initial TLB entry over as much RAM as we needAlexander Graf
The initial TLB entry is supposed to help us run the guest -kernel payload. This means the guest needs to be able to access its own memory, the initrd memory and the device tree. So far we only statically reserved a TLB entry from [0;256M[. This patch fixes it to span from [0;dt_end[, allowing the guest payload to access everything initially. Reported-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-04ppce500_mpc8544ds: Pass PowerPCCPU to mpc8544ds_cpu_reset[_sec]Andreas Färber
Allows us to use cpu_reset() in place of cpu_state_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de>
2012-06-04target-ppc: Let cpu_ppc_init() return PowerPCCPUAndreas Färber
Adapt e500 mpc8544ds machine accordingly. Turn cpu_init() into a static inline function returning CPUPPCState for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de>
2012-04-07Replace Qemu by QEMU in commentsStefan Weil
The official spelling is QEMU. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> [blauwirbel@gmail.com: fixed comment style in hw/sun4m.c] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-14ppc hw/: Don't use CPUStateAndreas Färber
Scripted conversion: for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do sed -i "s/CPUState/CPUPPCState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-14Rename cpu_reset() to cpu_state_reset()Andreas Färber
Frees the identifier cpu_reset for QOM CPUs (manual rename). Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-17ppcr500_mpc8544ds: convert to memory APIAvi Kivity
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-09Merge remote-tracking branch 'upstream' into memory/batchAvi Kivity
* upstream: (87 commits) target-alpha: Fix compilation errors for 32 bit hosts target-alpha: Add high-resolution access to wall clock and an alarm. target-alpha: Implement HALT IPR. target-alpha: Implement WAIT IPR. target-alpha: Add CLIPPER emulation. target-alpha: Add custom PALcode image for CLIPPER emulation. target-alpha: Honor icount for RPCC instruction. tcg/s390: Remove unused tcg_out_addi() tcg/ia64: Remove unused tcg_out_addi() ARM: fix segfault ppc64: Fix linker script pseries: Implement set-time-of-day RTAS function pseries: Refactor spapr irq allocation PPC: Clean up BookE timer code PPC: booke timers KVM: PPC: Use HIOR setting for -M pseries with PR KVM KVM: Update kernel headers KVM: Update kernel headers PPC: Fix heathrow PIC to use little endian MMIO PPC: Fix via-cuda memory registration ... Conflicts: hw/milkymist-uart.c hw/ppce500_mpc8544ds.c Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-06PPC: booke timersFabien Chouteau
While working on the emulation of the freescale p2010 (e500v2) I realized that there's no implementation of booke's timers features. Currently mpc8544 uses ppc_emb (ppc_emb_timers_init) which is close but not exactly like booke (for example booke uses different SPR). Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pagesScott Wood
This definition is backward compatible with MAV=1.0 as long as the guest does not set reserved bits in MAS1/MAS4. Also, fix the shift in booke206_tlb_to_page_size -- it's the base that should be able to hold a 4G page size, not the shift count. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06kvm: ppc: booke206: use MMU APIScott Wood
Share the TLB array with KVM. This allows us to set the initial TLB both on initial boot and reset, is useful for debugging, and could eventually be used to support migration. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Bump CPU count to 15Alexander Graf
Now that we have everything in place, make the machine description aware of the fact that we can now handle 15 virtual CPUs! Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - Max cpus is 15 because of MPIC
2011-10-06MPC8544DS: Generate CPU nodes on initAlexander Graf
With this patch, we generate CPU nodes in the machine initialization, giving us the freedom to generate as many nodes as we want and as the machine supports, but only those. This is a first step towards a much cleaner device tree generation infrastructure, where we would not require precompiled dtb blobs anymore. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Update cpu-release-addr property in cpu nodesAlexander Graf
The guest OS wants to know where the guest spins, so let's tell him while updating the CPU nodes with the frequencies anyways. Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - use new spin table address
2011-10-06PPC: E500: Add PV spinning codeAlexander Graf
CPUs that are not the boot CPU need to run in spinning code to check if they should run off to execute and if so where to jump to. This usually happens by leaving secondary CPUs looping and checking if some variable in memory changed. In an environment like Qemu however we can be more clever. We can just export the spin table the primary CPU modifies as MMIO region that would event based wake up the respective secondary CPUs. That saves us quite some cycles while the secondary CPUs are not up yet. So this patch adds a PV device that simply exports the spinning table into the guest and thus allows the primary CPU to wake up secondary ones. Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - change into MMIO scheme - map the secondary NIP instead of 0 1:1 - only map 64MB for TLB, same as u-boot - prepare code for 64-bit spinnings v2 -> v3: - remove r6 - set MAS2_M - map EA 0 - use second TLB1 entry v3 -> v4: - change to memoryops v4 -> v5: - fix endianness bugs v5 -> v6: - add header
2011-10-06PPC: E500: Remove unneeded CPU nodesAlexander Graf
We should only keep CPU nodes in the device tree around that we really have virtual CPUs for. So remove all superfluous entries that we just keep there in case someone wants to create a lot of vCPUs. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Update freqs for all CPUsAlexander Graf
Now that we can so nicely find out the host's frequencies, we should also make sure that we get them into all virtual CPUs' device tree nodes. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Remove mpc8544_copy_soc_cellAlexander Graf
We don't need mpc8544_copy_soc_cell anymore, since we're explicitly reading host values and writing guest values respectively. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Use generic kvm function for freqAlexander Graf
Now that we have generic KVM functions to read out the host tb and clock frequencies, let's use them in the e500 code! Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: Generate IRQ lines for many CPUsAlexander Graf
Now that we can generate multiple envs for all our virtual CPUs, we also need to tell the MPIC that we have multiple CPUs connected and connect them all to the respective virtual interrupt lines. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-06PPC: E500: create multiple envsAlexander Graf
When creating a VM, we should go through smp_cpus and create a virtual CPU for every CPU the user requested. This patch adds support for that and moves some code around to make that more convenient. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-10-02openpic: Memory API conversion for mpicFabien Chouteau
This patch converts mpic to the new memory API (through old mmio). Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02serial: Add MemoryRegion parameter to serial_mm_initRichard Henderson
Remove the get_system_memory() call from serial_mm_init, pushing it back into the callers. In many cases we already have the system memory region available. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02serial: Remove ioregister parameter from serial_mm_initRichard Henderson
All callers passed 1. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02serial: Use enum device_endian in serial_mm_init parameterRichard Henderson
The use of DEVICE_NATIVE_ENDIAN cleans up lots of ifdefs in many of the callers. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>