summaryrefslogtreecommitdiffstats
path: root/hw/musicpal.c
Commit message (Collapse)AuthorAgeFilesLines
* Add endianness as io mem parameterAlexander Graf2010-12-111-8/+16
| | | | | | | | | | | | | 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>
* 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>
* qemu_ram_alloc: Add DeviceState and name parametersAlex Williamson2010-07-061-4/+7
| | | | | | | | | | | 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>
* Remove useless device dependency of HAS_AUDIOBlue Swirl2010-06-271-4/+0
| | | | | | | | System architecture dictates whether HAS_AUDIO is defined. It's then useless to check for HAS_AUDIO in files which are only used on those architectures which always have audio. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* musicpal: Drop redundant reset callJan Kiszka2010-05-281-2/+0
| | | | | | | Reset is now triggered after init, no need for explicit calls anymore. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Compile pflash_cfi02 only onceBlue Swirl2010-03-291-1/+11
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile serial only onceBlue Swirl2010-03-211-2/+12
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Musicpal: Fix descriptor walk in eth_sendJan Kiszka2010-01-241-4/+3
| | | | | | | | | | | Commit 930c86820e introduced a regression to eth_send: eth_tx_desc_put manipulates the host's tx descriptor copy before writing it back, but two lines down the descriptor is evaluated again, leaving us with an invalid next address if host and guest endianness differ. So this was the actual issue commit 2e87c5b937 tried to paper over. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: malc <av1474@comtv.ru>
* Musicpal: Fix wm8750 I2C addressJan Kiszka2010-01-231-1/+1
| | | | | | | | | Commit b3a219883e uncovered that we attached the Wolfson with an I2C address shifted left by one. Fixing this makes sound work again for the Musicpal. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: malc <av1474@comtv.ru>
* net: convert musicpal to NICStateMark McLoughlin2009-12-031-13/+18
| | | | | Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* GPIO I2C reworkPaul Brook2009-11-221-1/+1
| | | | | | | | | | Reqrite bitbanging I2C implementation. New code improves stop/start condition handling, and gives more accurate input line level. Introduce intermediate abstraction layer for I2C bitbanging that is not connected via a GPIO port. Signed-off-by: Paul Brook <paul@codesourcery.com>
* musicpal: use qdev properties for configuration.Gerd Hoffmann2009-10-271-6/+11
| | | | | 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-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>
* musicpal: Add VMState supportJan Kiszka2009-10-051-23/+165
| | | | | | | | Register all relevant fields of Musicpal device states with the VMState framework. This involves a few type changes of state variables. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: Make PIT emulation more robustJan Kiszka2009-10-051-6/+28
| | | | | | | | Stop the periodic timers of the PIT on reset, disabling via the control register and invalid parameters. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: True reset support for GPIOJan Kiszka2009-10-051-3/+14
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: Coding style fixesJan Kiszka2009-10-051-25/+40
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: Clean up typecastsJan Kiszka2009-10-051-5/+5
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: Rework GPIO input eventsJan Kiszka2009-10-051-75/+75
| | | | | | | | | | | | | | | | The qdev_gpio conversion of 343ec8e caused come polarity mismatch of key event pins and left an overly complex solution behind. Take this chance and refactor the GPIO input system of the Musicpal, moving it closer to reality: - Instantiate all 32 GPIO input pins and do the routing only via qdev_connect_gpio_out. - Implement IMR and IER registers. They manage the GPIO pin IRQ. IMR seems to enable IRQs on rising edges, IER on falling ones. At least this matches what the Musicpal fireware require. - Move key pin logic inversion from the GPIO layer to musicpal_key. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* musicpal: Catch null TX qeueuesJan Kiszka2009-10-051-1/+3
| | | | | | | | | | They likely represent invalid queues that should be skipped. We already do this for RX queues. Wish I had a spec... Credits go to malc for analyzing the issue and suggesting this fix. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-18/+18
| | | | | | | | | | | | 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-18/+18
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-271-8/+19
| | | | | | | | | | | | | | | | | | 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>
* Make CPURead/WriteFunc structure 'const'Blue Swirl2009-08-251-16/+16
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove the unnecessary and only global in musicpal.cAndrzej Zaborowski2009-08-231-2/+1
|
* Make musicpal.c use the I2C device and the Marvell 88w8618 audio deviceAndrzej Zaborowski2009-08-231-387/+40
| | | | | Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
* Musicpal qdev conversion: gpio (except I2C part), keyboard and lcdBenoit Canet2009-08-231-84/+230
| | | | | Signed-off-by: Benoit Canet <benoit.canet@gmail.com> Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
* kill drives_tableGerd Hoffmann2009-07-271-5/+5
| | | | | | | | | | | | | | 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>
* qdev: rework device properties.Gerd Hoffmann2009-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-2/+2
| | | | | | | | | 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>
* Remove io_index argument from cpu_register_io_memory()Avi Kivity2009-06-161-9/+9
| | | | | | | | | 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>
* net: add return value to packet receive handlerMark McLoughlin2009-06-091-2/+3
| | | | | | | This allows us to handle queue full conditions rather than dropping the packet on the floor. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* net: pass VLANClientState* as first arg to receive handlersMark McLoughlin2009-06-091-3/+3
| | | | | | Give static type checking a chance to catch errors. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* net: re-name vc->fd_read() to vc->receive()Mark McLoughlin2009-06-091-1/+1
| | | | | | | | | VLANClientState's fd_read() handler doesn't read from file descriptors, it adds a buffer to the client's receive queue. Re-name the handlers to make things a little less confusing. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* net: add fd_readv() handler to qemu_new_vlan_client() argsMark McLoughlin2009-06-091-1/+1
| | | | | | | This, apparently, is the style we prefer - all VLANClientState should be an argument to qemu_new_vlan_client(). Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* Remove qdev irq sink handlingPaul Brook2009-05-261-2/+2
| | | | | | | We have both IRQ sinks and GPIO inputs. These are in principle exactly the same thing, so remove the former. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Add common BusStatePaul Brook2009-05-231-1/+1
| | | | | | | | | | | Implement and use a common device bus state. The main side-effect is that creating a bus and attaching it to a parent device are no longer separate operations. For legacy code we allow a NULL parent, but that should go away eventually. Also tweak creation code to veriry theat a device in on the right bus. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Introduce reset notifier orderJan Kiszka2009-05-221-2/+2
| | | | | | | | | | | | | | | Add the parameter 'order' to qemu_register_reset and sort callbacks on registration. On system reset, callbacks with lower order will be invoked before those with higher order. Update all existing users to the standard order 0. Note: At least for x86, the existing users seem to assume that handlers are called in their registration order. Therefore, the patch preserves this property. If someone feels bored, (s)he could try to identify this dependency and express it properly on callback registration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Convert machine registration to use module init functionsAnthony Liguori2009-05-211-1/+8
| | | | | | This cleans up quite a lot of #ifdefs, extern variables, and other ugliness. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* WM8750 qdev coversionPaul Brook2009-05-141-5/+2
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* MusicPal qdev conversionPaul Brook2009-05-141-63/+87
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Remove vga_ram_sizePaul Brook2009-05-131-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>
* Push AUD_init down to devicesPaul Brook2009-05-121-4/+1
| | | | | | | | Now we can safely call AUD_init multiple times we can push it down to individual audio devices, rather than having to pass it from the board init. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Make AUD_init failure fatalPaul Brook2009-05-121-4/+0
| | | | | | | | | | | | Failure to initialize the audio subsystem is not handled consistently. Where it is handled it has guest visible effects, which is wrong. We already have a "nosound" audio driver as a last resort, so trying to proceed without an audio backend seems pointless. Also protect against multiple calls to AUD_init so that this can be pushed down into individual devices. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Replace cpu_abort with hw_errorPaul Brook2009-05-081-1/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Introduce VLANClientState::cleanup() (Mark McLoughlin)aliguori2009-04-171-5/+15
| | | | | | | | | | | We're currently leaking memory and file descriptors on device hot-unplug. 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@7150 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove redundant ram_require machine properly.pbrook2009-04-111-2/+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
* Musicpal ram access cleanup.pbrook2009-04-101-59/+90
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7061 c046a42c-6fe2-441c-8c8c-71466251a162
* musicpal: Fix regression caused by 6839 (Jan Kiszka)aliguori2009-03-281-1/+2
| | | | | | | | | | Pass correct DisplayState field to is_surface_bgr(). Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6898 c046a42c-6fe2-441c-8c8c-71466251a162
* DisplayAllocator interface (Stefano Stabellini)aliguori2009-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi all, this patch adds a DisplayAllocator interface that allows display frontends (sdl in particular) to provide a preallocated display buffer for the graphical backend to use. Whenever a graphical backend cannot use qemu_create_displaysurface_from because its own internal pixel format cannot be exported directly (text mode or graphical mode with color depth 8 or 24), it creates another display buffer in memory using qemu_create_displaysurface and does the conversion. This new buffer needs to be blitted into the sdl surface buffer every time we need to update portions of the screen. We can avoid this using the DisplayAllocator interace: sdl provides its own implementation of qemu_create_displaysurface, giving back the sdl surface buffer directly (as we used to do before the DisplayState changes). Since the buffer returned by sdl could be in bgr format we need to put back in the handlers of that case. This approach is good if the two following conditions are true: 1) the sdl surface is a software surface that resides in main memory; 2) the host display color depth is either 16 or 32 bpp. If first condition is false we can have bad performances using sdl and vnc together. If the second condition is false performances are certainly not going to improve but they shouldn't get worse either. The first condition is always true, at least on linux/X11 systems; but I believe is true also on other platforms. The second condition is true in the vast majority of the cases. This patch should also have the good side effect of solving the sdl 2D slowness malc was reporting on MacOS, because SDL_BlitSurface is not going to be called anymore when the guest is in text mode or 24bpp. However the root problem is still present so I suspect we may still see some slowness on MacOS when the guest is in 32 or 16 bpp. 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@6839 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud