aboutsummaryrefslogtreecommitdiffstats
path: root/hw/r2d.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity1-1/+2
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-12-19sh_pci: remove sysbus_init_mmio_cb2 usageBenoît Canet1-2/+12
The isa region is not exposed as a sysbus region because the iobr register contains its address and use it to remap dynamically the region. (Peter Maydell's idea) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-24sh7750: convert memory controller/ioport to memory APIBenoît Canet1-1/+1
Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-24ide/mmio: convert to memory APIAvi Kivity1-1/+1
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-17r2d: convert to memory APIAvi Kivity1-20/+15
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-02sm501: Pass address_space_mem to sm501_initRichard Henderson1-1/+4
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-04pflash_cfi01/pflash_cfi02: convert to memory APIAvi Kivity1-1/+1
cfi02 is annoying in that is ignores some address bits; we probably want explicit support in the memory API for that. In order to get the correct opaque into the MemoryRegion object, the allocation scheme is changed so that the flash emulation code allocates memory, instead of the caller. This clears a FIXME in the flash code. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-03Use new macro QEMU_PACKED for packed structuresStefan Weil1-1/+1
Most changes were made using these commands: git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/' git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/' git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/' Whitespace in linux-user/syscall_defs.h was fixed manually to avoid warnings from scripts/checkpatch.pl. Manual changes were also applied to hw/pc.c. I did not fix indentation with tabs in block/vvfat.c. The patch will show 4 errors with scripts/checkpatch.pl. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-25Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"Anthony Liguori1-5/+2
This reverts commit 8ef9ea85a2cc1007eaefa53e6871f1f83bcef22d, reversing changes made to 444dc48298c480e42e15a8fe676be737d8a6b2a1. From Avi: Please revert the entire pull (git revert 8ef9ea85a2cc1) while I work this out - it isn't trivial. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-25pflash_cfi01/pflash_cfi02: convert to memory APIAvi Kivity1-2/+5
cfi02 is annoying in that is ignores some address bits; we probably want explicit support in the memory API for that. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-2/+2
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-01-20sh_pci: qdev conversionAurelien Jarno1-15/+3
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-14target-sh4: fix reset on r2dAurelien Jarno1-1/+20
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-12-11Add endianness as io mem parameterAlexander Graf1-1/+2
As stated before, devices can be little, big or native endian. The target endianness is not of their concern, so we need to push things down a level. This patch adds a parameter to cpu_register_io_memory that allows a device to choose its endianness. For now, all devices simply choose native endian, because that's the same behavior as before. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-08-24Rearrange block headersBlue Swirl1-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>
2010-07-06qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson1-2/+2
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>
2010-06-29r2d: fix pflash mappingAurelien Jarno1-0/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-25sh4: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-13r2d: always enable IDE and flashAurelien Jarno1-10/+8
IDE and flash are part of the R2D board, and can't be removed. Emulate them even if there is no hard-drive plugged to the IDE or if the flash content is empty.
2010-04-11hw/r2d: add initrd supportAurelien Jarno1-21/+59
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-11hw/r2d: add flash memoryAurelien Jarno1-0/+13
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-02hw/r2d: add a USB keyboardAurelien Jarno1-0/+4
The R2D board does not have a PS/2 port, and only support a keyboard on the USB bus. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-08SH4/R2D: fix poweroffAurelien Jarno1-4/+5
The write the the PA_POWOFF register is currently ignored. Fix that by calling qemu_system_shutdown_request() when a poweroff is requested. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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-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-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-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-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>
2009-09-04ide: pass down DriveInfo instead of BlockDriverStateGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04We want the argument pass to set_irq to be opaqueJuan Quintela1-1/+3
piix_pci want to pass more things that the pic Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27ide: split away ide-mmio.cGerd Hoffmann1-0/+1
create ide-mmio.c and place mmio support there. only build ide-mmio support for platforms using it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-25Make CPURead/WriteFunc structure 'const'Blue Swirl1-2/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-27kill drives_tableGerd Hoffmann1-2/+3
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-06-22Support addr=... in option argument of -net nicMarkus Armbruster1-1/+1
Make net_client_init() accept addr=, put the value into struct NICinfo. Use it in pci_nic_init(), and remove arguments bus and devfn. Don't support addr= in third argument of monitor command pci_add, because that clashes with its first argument. Admittedly unelegant. Machines "malta" and "r2d" have a default NIC with a well-known PCI address. Deal with that the same way as the NIC model: make pci_nic_init() take an optional default to be used when the user doesn't specify one. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16Remove io_index argument from cpu_register_io_memory()Avi Kivity1-1/+1
The parameter is always zero except when registering the three internal io regions (ROM, unassigned, notdirty). Remove the parameter to reduce the API's power, thus facilitating future change. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Convert machine registration to use module init functionsAnthony Liguori1-1/+8
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-13Remove vga_ram_sizePaul Brook1-1/+1
The vga_ram_size argument to machine init functions always has the same value, and is ignored by many machines (including SPARC32 which has an obsolete ifdef for VGA_RAM_SIZE). Remove it and push VGA_RAM_SIZE into vga_int.h. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-04-19Adds SM501 usb host emulation feature.aurel321-1/+1
It makes usb keyboard available for sh4/r2d system emulation. The changes for "hw/usb-ohci.c" are as follows. - 'localmem_base' is introduced as OHCIState struct member. SM501 has a local memory, and it is used to pass and receive data with OHCI driver. OHCI driver accesses it with SH4 physical memory address, and SM501 accesses it with SM501 local address. 'localmem_base' holds where the SM501 local memory is mapped into SH4 physical address space. - Memory access functions modified to adjust address with 'localmem_base'. The functions are, ohci_read_*(), ohci_put_*(), and ohci_copy_*(). - ohci_read_hcca() and ohci_put_hcca() are introduced for more consistent implementation. For other source files, it does, - introduces usb_ohci_init_sm501(). - adds irq argument for SM501 initialization, to emulate USB interrupts. Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7188 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-11Remove redundant ram_require machine properly.pbrook1-1/+0
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7090 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-10More phys_ram_base removal.pbrook1-4/+2
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7060 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-28target-sh4: r2d --append option supportaurel321-3/+2
Remove qemu_ram_alloc(SDRAM_BASE) and related changes. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6919 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-28target-sh4: r2d --append option supportaurel321-5/+16
Add linux kernel command line ("--append" option) support. Fix kernel loading address to appropriate position when --append used. Using --kernel but --append case is left untouched for backward compatibility. This also change the host<->SH address mapping for r2d to host addr == phys_ram_base + SH addr. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6916 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-03sh4: r2d fix no ide/net caseaurel321-5/+5
Fix invalid access/crash when there is no IDE device or NET device. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Tested-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6673 c046a42c-6fe2-441c-8c8c-71466251a162
2009-02-05hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori1-2/+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
2009-01-24sh4: r2d. Endian conversion for peripheral register initialization.aurel321-4/+2
Add endian conversion to hw/r2d.c which lacks consideration of endian on setting BSC registers. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6431 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-16graphical_console_init change (Stefano Stabellini)aliguori1-2/+2
Patch 5/7 This patch changes the graphical_console_init function to return an allocated DisplayState instead of a QEMUConsole. This patch contains just the graphical_console_init change and few other modifications mainly in console.c and vl.c. It was necessary to move the display frontends (e.g. sdl and vnc) initialization after machine->init in vl.c. This patch does *not* include any required changes to any device, these changes come with the following patches. Patch 6/7 This patch changes the QEMUMachine init functions not to take a DisplayState as an argument because is not needed any more; In few places the graphic hardware initialization function was called only if DisplayState was not NULL, now they are always called. Apart from these cases, the rest are all mechanical substitutions. Patch 7/7 This patch updates the graphic device code to use the new graphical_console_init function. As for the previous patch, in few places graphical_console_init was called only if DisplayState was not NULL, now it is always called. Apart from these cases, the rest are all mechanical substitutions. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6344 c046a42c-6fe2-441c-8c8c-71466251a162
2009-01-13Make pci_nic_init() use qemu_setup_nic_model() (Mark McLoughlin)aliguori1-2/+2
Add a table of PCI NIC models to pass to qemu_setup_nic_model(). While we're at it, also add a corresponding table of NIC init functions. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6287 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-07SH4: kill a few warningsaurel321-2/+2
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5938 c046a42c-6fe2-441c-8c8c-71466251a162
2008-12-07SH: r2d pci support (Takashi YOSHII).balrog1-0/+27
This patch adds pci support to sh/r2d board. This is the first user of PCIC support I formerly sent. PCIC actually is inside of chip with CPU core on SH7751. But, this code is written as if SH7750 and PCIC are on board. I care little about physical device boundary, but fitting with qemu's design. This patch also adds some BSC (Bus State Controller) registers, because PCI device driver software have to accesses them. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5932 c046a42c-6fe2-441c-8c8c-71466251a162