summaryrefslogtreecommitdiffstats
path: root/hw/sun4m.c
Commit message (Collapse)AuthorAgeFilesLines
* sparc32: ledma extra registersBob Breuer2010-12-181-7/+9
| | | | | | | | | | ledma has 0x20 bytes of registers according to OBP, and at least Solaris9 reads the 5th register which is beyond what we've mapped. So let's setup a flag (inspired by a previous patch from Blue Swirl) to identify ledma from espdma, and map another 16 bytes of registers which return 0. Signed-off-by: Bob Breuer <breuerr@mc.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc32: convert debug printf statements to tracepointsBlue Swirl2010-10-311-13/+5
| | | | | | Replace debug printf statements with tracepoints. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* ESP: fix ESP DMA access when DMA is not enabledBlue Swirl2010-09-111-9/+14
| | | | | | | | | | | | | | Sending ESP a command caused it to trigger DMA immediately even if DMA was not enabled at the DMA controller. Add a signal from DMA controller to ESP to tell ESP about changes in DMA enable bit. Also use the correct function for setting up GPIO outputs. This fixes NetBSD 1.6.1 through 3.0 boot. Thanks to Artyom Tarasenko for extensive debugging of the problem. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rearrange block headersBlue Swirl2010-08-241-0/+1
| | | | | | | | | Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc32: use FW_CFG_CMDLINE_SIZEBlue Swirl2010-08-031-0/+3
| | | | | | | Add support for getting kernel command line size with FW_CFG_CMDLINE_SIZE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: reserve addresses for unimplemented devices on SS-20Bob Breuer2010-07-201-2/+51
| | | | | | | | | Use empty_slot to reserve addresses for several unimplemented devices so they won't fault. - BPP (parallel port), DBRI (audio), SX (pixel processor), and vsimms (framebuffer) OBP for SS-20 either assumes these devices exist or probes without expecting faults. Signed-off-by: Bob Breuer <breuerr@mc.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson2010-07-061-4/+4
| | | | | | | | | | | These will be used to generate unique id strings for ramblocks. The name field is required, the device pointer is optional as most callers don't have a device. When there's no device or the device isn't a child of a bus implementing BusInfo.get_dev_path, the name should be unique for the platform. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Pad iommu with an empty slot (necessary for SunOS 4.1.4)Artyom Tarasenko2010-05-291-1/+13
| | | | | | | | | | On the real hardware (SS-5, LX) the MMU is not padded, but aliased. Software shouldn't use aliased addresses, neither should it crash when it uses (on the real hardware it wouldn't). Using empty_slot instead of aliasing can help with debugging such accesses. Signed-off-by: Artyom Tarasenko <atar4qemu@googlemail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile dma only onceBlue Swirl2010-05-221-1/+5
| | | | | | | | Use a qemu_irq to request CPU exit. 7 compilations less for the full build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc32 use empty_slot for missing RAM v1Artyom Tarasenko2010-04-181-0/+5
| | | | | | | | | | | use empty_slot device for the RAM which is not installed Models without ECC don't trap when missing ram is accessed. v0->v1 compile only once and fix indentation Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* load_elf: replace the address addend by a translation functionAurelien Jarno2010-03-161-4/+15
| | | | | | | | | | | | | | | | A few machines need to translate the ELF header addresses into physical addresses. Currently the only possibility is to add a value to the addresses. This patch replaces the addend argument by and a translation function and an opaque passed to the function. A NULL function does not translate the address. The patch also convert all machines that have an addend, simplify the PowerPC kernel loading and fix the MIPS kernel loading using this new feature. Other machines may benefit from this feature. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* m48t59: don't use reserved _t suffixBlue Swirl2010-02-071-3/+3
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: remove unused env/envs variables, spotted by clangBlue Swirl2010-01-131-10/+5
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc: make command line available also via firmware configuration deviceBlue Swirl2009-12-271-0/+9
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: implement AFX for SS-5Artyom Tarasenko2009-12-131-1/+41
| | | | | | | | | | Implement a stub for the AFX register on SparcStation-5. This stub is needed for running the original SS-5 OBP instead of OpenBIOS (which allows to boot Solaris 2.5.1 and Solaris 2.6 kernels). Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* scsi: move scsi.h -> esp.hGerd Hoffmann2009-11-091-1/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pcnet: use qdev properties for configuration.Gerd Hoffmann2009-10-271-1/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rom loader: fix sparc -kernel boot.Gerd Hoffmann2009-10-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* New qdev_init_nofail()Markus Armbruster2009-10-071-14/+14
| | | | | | | | | | | | | | | | | | | Like qdev_init(), but terminate program via hw_error() instead of returning an error value. Use it instead of qdev_init() where terminating the program on failure is okay, either because it's during machine construction, or because we know that failure can't happen. Because relying in the latter is somewhat unclean, and the former is not always obvious, it would be nice to go back to qdev_init() in the not-so-obvious cases, only with proper error handling. I'm leaving that for another day, because it involves making sure that error values are properly checked by all callers. Patchworks-ID: 35168 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* floppy: add drive properties.Gerd Hoffmann2009-10-051-12/+4
| | | | | 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-59/+59
| | | | | | | | | | | | 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-59/+59
| | | | | | | 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-3/+14
| | | | | | | | | | | | | 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>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-271-3/+6
| | | | | | | | | | | | | | | | | | Sorry folks, but it has to be. One more of these invasive qdev patches. We have a serious design bug in the qdev interface: device init callbacks can't signal failure because the init() callback has no return value. This patch fixes it. We have already one case in-tree where this is needed: Try -device virtio-blk-pci (without drive= specified) and watch qemu segfault. This patch fixes it. With usb+scsi being converted to qdev we'll get more devices where the init callback can fail for various reasons. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Sparc32: improve interrupt handlingBlue Swirl2009-08-251-5/+2
| | | | | | | | | | | | | | | | | Level 15 interrupts are broadcast to all CPUs, each CPU can clear the interrupt using the local Clear Pending register. Update intbit_to_level table. Don't try to raise level 0 interrupts. Calculate pending interrupts based on the separate inputs from master register. Setting or resetting the pending level isn't correct because of overlap of levels. Level 14 is always used for CPU timer interrupts, remove the property. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: fix monitor commands 'info pic' and 'info irq'Blue Swirl2009-08-231-8/+7
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev/prop: convert sun4m.c to helper macros.Gerd Hoffmann2009-08-101-6/+2
| | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
* Use qemu_irq for system_powerdownBlue Swirl2009-08-091-8/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: use qemu_irq for system_powerdownBlue Swirl2009-08-091-18/+16
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: move sparc32_dma init to sun4m.cBlue Swirl2009-08-081-19/+40
| | | | | | Also connect ESP and Lance reset signals to DMA. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: remove VRAM and NVRAM sizes from hwdefBlue Swirl2009-08-081-36/+6
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: remove IRQ numbers from hwdefBlue Swirl2009-08-081-135/+25
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: move intbit_to_level table back to slavio_intctl.cBlue Swirl2009-08-081-41/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: move device instantiation to sun4m.cBlue Swirl2009-08-081-0/+217
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* kill drives_tableGerd Hoffmann2009-07-271-8/+8
| | | | | | | | | | | | | | First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Sparc32: convert Sun4c interrupt controller to qdevBlue Swirl2009-07-211-3/+8
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert SBI to qdevBlue Swirl2009-07-211-3/+11
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32/64: use 64 bit type for memory sizeBlue Swirl2009-07-211-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: Fix lanceBlue Swirl2009-07-211-0/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix sparc-softmmu breakage by ee6847d19be16c789b8bd4e553b7cd6701ba1245Blue Swirl2009-07-171-1/+1
| | | | | | | Move the qdev_init(dev); call after the setting of d->size. Thanks to Filip Navara. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: rework device properties.Gerd Hoffmann2009-07-161-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a major overhaul of the device properties. The properties are saved directly in the device state struct now, the linked list of property values is gone. Advantages: * We don't have to maintain the list with the property values. * The value in the property list and the value actually used by the device can't go out of sync any more (used to happen for the pci.devfn == -1 case) because there is only one place where the value is stored. * A record describing the property is required now, you can't set random properties any more. There are bus-specific and device-specific properties. The former should be used for properties common to all bus drivers. Typical use case is bus addressing, i.e. pci.devfn and i2c.address. Properties have a PropertyInfo struct attached with name, size and function pointers to parse and print properties. A few common property types have PropertyInfos defined in qdev-properties.c. Drivers are free to implement their own very special property parsers if needed. Properties can have default values. If unset they are zero-filled. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Sparc32: convert slavio interrupt controller to qdevBlue Swirl2009-07-161-7/+14
| | | | | | Also increase QDEV_MAX_IRQ. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: refactor CPU initBlue Swirl2009-07-161-45/+30
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert memory to qdevBlue Swirl2009-07-161-36/+56
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert boot prom to qdevBlue Swirl2009-07-161-87/+67
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert cs4231 to qdevBlue Swirl2009-07-161-2/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert sparc32_dma to qdevBlue Swirl2009-07-151-9/+9
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert slavio_misc to qdevBlue Swirl2009-07-131-9/+11
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: convert idreg to qdevBlue Swirl2009-07-131-8/+42
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-5/+5
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud