summaryrefslogtreecommitdiffstats
path: root/hw/ppc.c
Commit message (Collapse)AuthorAgeFilesLines
* powerpc: Make the decr interrupt type overridableEdgar E. Iglesias2010-09-241-3/+13
| | | | | | | | Make it possible for boards to override the kind of interrupt to be signaled when the decr timer hits. The 405's signal PIT interrupts while the 440's signal DECR. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* KVM: PPC: Add level based interrupt logicAlexander Graf2010-09-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | KVM on PowerPC used to have completely broken interrupt logic. Usually, interrupts work by having a PIC that pulls a line up/down, so the CPU knows that an interrupt is active. This line stays active until some action is done to the PIC to release the line. On KVM for PPC, we just checked if there was an interrupt pending and pulled a line in the kernel module. We never released it though, hoping that kernel space would just declare an interrupt as released when injected - which is wrong. To fix this, we need to completely redesign the interrupt injection logic. Whenever an interrupt line gets triggered, we need to notify kernel space that the line is up. Whenever it gets released, we do the same. This way we can assure that the interrupt state is always known to kernel space. This fixes random stalls in KVM guests on PowerPC that were waiting for an interrupt while everyone else thought they received it already. Signed-off-by: Alexander Graf <agraf@suse.de>
* target-ppc: remove dead codeThomas Monjalon2010-05-181-10/+0
| | | | | | | | | | | This function had been disabled from the beginning: see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5 cpu_reset() function is in target-ppc/helper.c Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: Make DCR uint32_tAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | For what I know DCR is always 32 bits wide, so we should also use uint32_t to pass it along the stacks. This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making it compile without --disable-werror Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix alternate timebaseAurelien Jarno2009-12-211-2/+2
| | | | | | | Fix the alternate time base the same way as the default timebase. SPR_ATBL should return a 64-bit value on 64 bit implementations. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix timebaseAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | | | | | On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL. On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full 64 bits as return value. If we only take the lower ones, fine. But Linux wants to see all 64 bits or it breaks. This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary, which usually happened a few seconds after bootup. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: rename cpu_ppc_reset to cpu_reset for consistencyBlue Swirl2009-11-071-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rom loader: fix sparc -kernel boot.Gerd Hoffmann2009-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changes: (1) register pstrcpy_targphys() in rom list, it is used for kernel command lines by a number of architectures. (2) add rom_ptr() function to get a pointer for applying changes to loaded images. Needed for example to tell the linux kernel where it finds the initrd image by updating the header. (3) make sparc use rom_ptr for initrd setup. booting sparc-test works now, and 'info roms' shows this: (qemu) info roms addr=0000000000000000 size=0x2a3828 mem=ram name="phdr #0: vmlinux-2.6.11+tcx" addr=00000000007ff000 size=0x00000e mem=ram name="cmdline" addr=0000000000800000 size=0x400000 mem=ram name="/root/qemu-test/sparc-test/linux.img" addr=0000000070000000 size=0x0e4000 mem=rom name="phdr #0: /home/kraxel/projects/qemu/build-zfull/pc-bios/openbios-sparc32" reboot via 'system_reset' works too. Patchworks-ID: 35262 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-66/+66
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-66/+66
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Compile loader only onceBlue Swirl2009-09-201-0/+1
| | | | | | | | | | | | | Callers must pass ELF machine, byte swapping and symbol LSB clearing information to ELF loader. A.out loader needs page size information, pass that too as a parameter. Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw. Adjust callers. Also use target_phys_addr_t instead of target_ulong for addresses: loader addresses aren't virtual. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela2009-09-111-9/+9
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plxBlue Swirl2009-08-161-14/+14
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Replace always_inline with inlineBlue Swirl2009-08-161-15/+13
| | | | | | We define inline as always_inline. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-ppc: fix typo in _cpu_ppc_load_decrTristan Gingold2009-07-121-4/+4
| | | | | | | | | Use parameter 'next' to fix the hdecr case. Also pass 'next' by value instead of pointer (more easy to read and no performance issue for an always_inline function). Signed-off-by: Tristan Gingold <gingold@adacore.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Yet more phys_ram_base elimination.pbrook2009-04-101-1/+1
| | | | | | | Signed-off-by: Paul Brook <paul@cofdesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7067 c046a42c-6fe2-441c-8c8c-71466251a162
* kvm/powerpc: Add irq support for E500 coreaurel322009-03-021-0/+60
| | | | | | | Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6662 c046a42c-6fe2-441c-8c8c-71466251a162
* hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-7/+0
| | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
* Convert references to logfile/loglevel to use qemu_log*() macrosaliguori2009-01-151-8/+2
| | | | | | | | | | | | This is a large patch that changes all occurrences of logfile/loglevel global variables to use the new qemu_log*() macros. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6338 c046a42c-6fe2-441c-8c8c-71466251a162
* Clean up debugging code #ifdefs (Eduardo Habkost)aliguori2009-01-151-245/+68
| | | | | | | | | | | | | | | Use macros to avoid #ifdefs on debugging code. This patch doesn't try to merge logging macros from different files, but just unify the debugging code #ifdefs onto a macro on each file. A further cleanup can unify the debugging macros on a common header, later Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix undeclared symbol warnings from sparseblueswir12008-10-261-2/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
* Use qemu-log.hblueswir12008-10-041-3/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5413 c046a42c-6fe2-441c-8c8c-71466251a162
* Suppress gcc 4.x -Wpointer-sign (included in -Wall) warningsblueswir12008-09-201-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
* More PowerPC debug print fixes - hardware emulation pass.j_mayer2007-11-241-19/+20
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3726 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* Add missing definition for number of input pins for the PowerPC 970 bus.j_mayer2007-11-171-2/+4
| | | | | | | | Use proper INPUT_NB definitions to allocate PowerPC input pins structure, fixing a buffer overflow in the 6xx bus case. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3659 c046a42c-6fe2-441c-8c8c-71466251a162
* Always make all PowerPC exception definitions visible.j_mayer2007-11-171-13/+11
| | | | | | | | | Always make the hypervisor timers available. Remove all TARGET_PPC64H checks, keeping a few if (0) tests for cases that cannot be properly handled with the current PowerPC CPU definition. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3656 c046a42c-6fe2-441c-8c8c-71466251a162
* Temporary hack to avoid Qemu crash at PowerPC reset time.j_mayer2007-10-291-2/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3482 c046a42c-6fe2-441c-8c8c-71466251a162
* * sort the PowerPC target object filesj_mayer2007-10-281-28/+39
| | | | | | | | | | | | | | | | * make PowerPC NVRAM accessors generic to be able to use a MacIO NVRAM instead of the M48T59 one * split PowerMac targets code: - move all PowerMac related definitions and prototypes into hw/ppc_mac.h - add hw/mac_dbdma.c, hw/mac_nvram.c and macio.c which implements shared PowerMac devices - define the g3bw machine in a new hw/ppc_oldworld.c file * Fix the g3bw target: - fix the Grackle host PCI device - connect the Heathrow PIC to the PowerPC 6xx bus pins git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3475 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement time-base start/stop helpers.j_mayer2007-10-141-29/+92
| | | | | | | Implement PowerPC 6xx time-base enable input pin. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3394 c046a42c-6fe2-441c-8c8c-71466251a162
* Do not allow PowerPC CPU restart after entering checkstop mode.j_mayer2007-10-141-7/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3388 c046a42c-6fe2-441c-8c8c-71466251a162
* PowerPC target coding style fixes.j_mayer2007-10-071-6/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3348 c046a42c-6fe2-441c-8c8c-71466251a162
* PowerPC target optimisations: make intensive use of always_inline.j_mayer2007-10-071-13/+15
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3347 c046a42c-6fe2-441c-8c8c-71466251a162
* We never have to export ppc_set_irq.j_mayer2007-10-031-1/+3
| | | | | | | Protect PowerPC 64 only features with #ifdef (TARGET_PPC64) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3316 c046a42c-6fe2-441c-8c8c-71466251a162
* Share input pins and internal interrupt controller between all PowerPC 40x.j_mayer2007-10-011-14/+13
| | | | | | | Fix critical input interrupt generation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3299 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix compilation on Darwin platform, avoiding the use of gcc function attributesj_mayer2007-09-301-4/+18
| | | | | | | | (problem reported by Andreas Farber). : ---------------------------------------------------------------------- git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3292 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement the PowerPC alternate time-base, following the 2.04 specification.j_mayer2007-09-301-23/+72
| | | | | | | | Share most code with the time-base management routines. Remove time-base write routines from user-mode emulation environments. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3277 c046a42c-6fe2-441c-8c8c-71466251a162
* Code provision for hypervisor timers resources,j_mayer2007-09-291-7/+100
| | | | | | | as described in PowerPC 2.04 specification. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3264 c046a42c-6fe2-441c-8c8c-71466251a162
* Great rework and cleanups to ease PowerPC implementations definitions.j_mayer2007-09-261-2/+5
| | | | | | | | | | | | | | | | | * cleanup cpu.h, removing definitions used only in translate.c/translate_init.c * add new flags to define instructions sets more precisely * various changes in MMU models definitions * add definitions for PowerPC 440/460 support (insns and SPRs). * add definitions for PowerPC 401/403 and 620 input pins model * Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0 * Preliminary support for PowerPC 74xx (aka G4) without altivec. * Code provision for other PowerPC support (7x5, 970, ...). * New SPR and PVR defined, from PowerPC 2.04 specification and other sources * Misc code bugs, error messages and styles fixes. * Update status files for PowerPC cores support. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
* find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths2007-09-171-1/+1
| | | | | | the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
* find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths2007-09-161-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
* PowerPC embedded timers fixes.j_mayer2007-04-241-53/+101
| | | | | | | Improve PowerPC timers debug. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2715 c046a42c-6fe2-441c-8c8c-71466251a162
* Add callbacks to allow dynamic change of PowerPC clocks (to be improved)j_mayer2007-04-161-29/+68
| | | | | | | | | | | Fix embedded PowerPC watchdog and timers Fix PowerPC 405 SPR Add generic PowerPC 405 core instanciation code + resets support. Implement simple peripherals shared by most PowerPC 405 implementations PowerPC 405 EC & EP microcontrollers preliminary support git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2690 c046a42c-6fe2-441c-8c8c-71466251a162
* Add bus model (or input pins) into PowerPC CPU flags.j_mayer2007-04-161-0/+122
| | | | | | | | Add PowerPC 970 bus and exceptions model. Add code provision for PowerPC 970 instanciation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2680 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix a lot of debug traces for PowerPC emulation: use logfile instead of stdoutj_mayer2007-04-161-27/+79
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2677 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix miscellaneous display warnings for PowerPC & alpha targetsj_mayer2007-04-141-7/+8
| | | | | | | and parallel CFI flash driver. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2661 c046a42c-6fe2-441c-8c8c-71466251a162
* Add PowerPC 405 input pins (IRQ, resets, ...) model.j_mayer2007-04-121-8/+94
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2654 c046a42c-6fe2-441c-8c8c-71466251a162
* Embedded PowerPC Device Control Registers infrastructure.j_mayer2007-04-121-0/+95
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2653 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement embedded IRQ controller for PowerPC 6xx/740 & 750.j_mayer2007-04-091-38/+88
| | | | | | | | | | | | | Fix PowerPC external interrupt input handling and lowering. Fix OpenPIC output pins management. Fix multiples bugs in OpenPIC IRQ management. Fix OpenPIC CPU(s) reset function. Fix Mac99 machine to properly route OpenPIC outputs to the PowerPC input pins. Fix PREP machine to properly route i8259 output to the PowerPC external interrupt pin. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2647 c046a42c-6fe2-441c-8c8c-71466251a162
* Unify IRQ handling.pbrook2007-04-071-2/+12
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud