summaryrefslogtreecommitdiff
path: root/hw/sun4u.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-26sparc64: clean up pci bridge mapIgor V. Kovalenko1-2/+2
- remove unused host state and store pci bus pointer only - do not map host state access into unused 1fe.10000000 range - reorder pci region registration - assign pci i/o region to isa_mem_base Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-26sparc64: rename sun4u cpu to Ultrasparc IIiIgor V. Kovalenko1-1/+1
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22Compile dma only onceBlue Swirl1-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>
2010-03-21Compile serial only onceBlue Swirl1-1/+1
Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21Compile isa_mmio only onceBlue Swirl1-2/+2
Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-16load_elf: replace the address addend by a translation functionAurelien Jarno1-4/+10
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>
2010-02-07m48t59: don't use reserved _t suffixBlue Swirl1-11/+10
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-27sparc64: reimplement tick timers v4Igor V. Kovalenko1-33/+173
sparc64 timer has tick counter which can be set and read, and tick compare value used as deadline to fire timer interrupt. The timer is not used as periodic timer, instead deadline is set each time new timer interrupt is needed. v3 -> v4: - coding style v2 -> v3: - added missing timer debug output macro - CPUTimer struct and typedef moved to cpu.h - change CPU_SAVE_VERSION to 6, older save formats not supported v1 -> v2: - new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks - save offset from clock source to implement cpu_tick_set_count - renamed struct sun4u_timer to CPUTimer - load and save cpu timers v0 -> v1: - coding style Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-24Sparc64: fix initrdBlue Swirl1-3/+5
Fix HdrS offsets for Sparc64. The initrd address must be offset by KERNBASE. Use rom_ptr mechanism to actually write to the kernel image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-09Sparc64: use firmware configuration device for command line storageBlue Swirl1-3/+3
Avoid a ROM conflict. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-08sparc64: interrupt trap handlingIgor V. Kovalenko1-13/+35
cpu_check_irqs - handle SOFTINT register TICK and STICK timer bits - only check interrupt levels greater than PIL value - handle preemption by higher level traps cpu_exec - handle CPU_INTERRUPT_HARD only if interrupts are enabled - PIL 15 is not special level on sparcv9 Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-08sparc64: add macros to deal with softint and timer interruptIgor V. Kovalenko1-1/+0
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-30Sparc64: split DPRINTF into CPUIRQ and EBUS versionsBlue Swirl1-8/+16
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-30Sparc64: fix compile with DEBUG_IRQ enabledBlue Swirl1-1/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-27sparc: make command line available also via firmware configuration deviceBlue Swirl1-0/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-01pci: pci.h cleanup: move out stuff not in pci.cMichael S. Tsirkin1-0/+1
pci.h declares some functions which aren't defined in pci.h. Clean up moving things to appropriate headers, and update all users. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-11-09pci: introduce pcibus_t to represent pci bus address/size instead of uint32_tIsaku Yamahata1-1/+1
This patch is preliminary for 64 bit BAR support. Introduce dedicated type, pcibus_t, to represent pci bus address/size instead of uint32_t. Later this type will be changed to uint64_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.hIsaku Yamahata1-2/+2
make constants for pci base address match pci_regs.h by renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-07Sparc64/x86: remove unneeded calls to device resetBlue Swirl1-7/+9
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-24sparc64: remove unused variablesBlue Swirl1-3/+0
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-12rom loader: fix sparc -kernel boot.Gerd Hoffmann1-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>
2009-10-07New qdev_init_nofail()Markus Armbruster1-2/+2
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>
2009-10-05Fix pci_add nic not to exit on bad modelMarkus Armbruster1-1/+1
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() to create the NIC. When MODEL is unknown or "?", this prints to stderr and terminates the program. Change pci_nic_init() not to treat "?" specially, and to return NULL on failure. Switch uses during startup to new convenience wrapper pci_nic_init_nofail(), which behaves just like pci_nic_init() used to do. Bonus bug fix: we now check for qdev_init() failing there. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05serial: convert isa to qdevGerd Hoffmann1-5/+1
Everything using standard isa I/O ports and IRQ windup is considerd being an actual isa device. That are all serial_init() users except mips_mipssim() which seems to have a non-standard IRQ windup. baud rate is fixed at 115200 now as no caller passed in something else. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05floppy: add drive properties.Gerd Hoffmann1-4/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05parallel: convert isa to qdevGerd Hoffmann1-2/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-12/+12
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>
2009-10-01Get rid of _t suffixmalc1-12/+12
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-09-20Compile loader only onceBlue Swirl1-3/+15
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>
2009-09-14Add an ISA bus version of m48t59Blue Swirl1-2/+1
Many thanks to Gerd Hoffmann for finding and fixing a bug in the initial version. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-10qdev: simplify isa irq assignmentsGerd Hoffmann1-1/+1
isa-bus owns the isa irqs now, so it can hand them out directly. There is no need for the separate isa_connect_irqs step, drop it. Also hard-code isa interrupts which can't be configured anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: drop iobase properties from isa busGerd Hoffmann1-2/+2
Lot of ISA devices work at fixed addresses, so having iobase as bus property doesn't make much sense. Devices which can have different iobases will get a device property. Also simply hard-code stuff which can't be configured anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-06Sparc64: use ISA bus for i8042Blue Swirl1-2/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-06Sparc64: remove unused variablesBlue Swirl1-7/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-04ide: pass down DriveInfo instead of BlockDriverStateGerd Hoffmann1-3/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-28Fix Sparc64 breakage: add dummy ISA irqsBlue Swirl1-0/+8
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-27ide: split away ide-pci.cGerd Hoffmann1-0/+1
create ide-pci.c and place pci bus support there. only build ide-pci support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Fix build (merge with isa mmio split)
2009-08-27qdev: add return value to init() callbacks.Gerd Hoffmann1-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>
2009-08-27isa bus irq changes and fixes.Gerd Hoffmann1-1/+1
Changes: (1) make isa-bus maintain isa irqs, complain when allocating already taken irqs. (2) note that (1) works only for isa devices converted to qdev already (floppy and ps2/kbd/mouse right now), so more work is needed to make this really useful. (3) split floppy init into isa and sysbus versions. (4) add sysbus->isa bridge & fix -M isapc breakage. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-13Unbreak Sparc64Blue Swirl1-0/+2
EBus is a sort of ISA bus. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-10qdev/prop: convert sun4u.c to helper macros.Gerd Hoffmann1-6/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-09Use qemu_irq for system_powerdownBlue Swirl1-4/+0
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-08Sparc64: configure screen size from QEMU command line optionsBlue Swirl1-0/+8
Use the FW_CFG interface to send user requested screen size and depth to OpenBIOS like 7f1aec5f93382eef75920899f4065613aeaf02a2 for ppc_oldworld. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-27kill drives_tableGerd Hoffmann1-12/+6
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>
2009-07-21Sparc32/64: use 64 bit type for memory sizeBlue Swirl1-2/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: refactor kernel initBlue Swirl1-42/+55
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: refactor CPU initBlue Swirl1-19/+27
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: convert memory to qdevBlue Swirl1-4/+59
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: convert boot prom to qdevBlue Swirl1-29/+62
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-12Sparc64: convert ebus to qdevBlue Swirl1-2/+18
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>