summaryrefslogtreecommitdiffstats
path: root/hw/esp.c
Commit message (Collapse)AuthorAgeFilesLines
* Add endianness as io mem parameterAlexander Graf2010-12-111-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>
* ESP: fix ESP DMA access when DMA is not enabledBlue Swirl2010-09-111-2/+51
| | | | | | | | | | | | | | 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>
* scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callersMarkus Armbruster2010-07-021-2/+1
| | | | | | | | | | | | | | None of its callers checks for failure. scsi_hot_add() can crash because of that: (qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1 scsi-generic: scsi generic interface too old Segmentation fault (core dumped) Fix all callers, not just scsi_hot_add(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* esp: lower IRQ on soft resetBlue Swirl2010-06-101-5/+14
| | | | | | | | | | 42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq lowering during reset. However, for chip reset command and DMA reset signal, its actually the correct thing to do. Lower IRQ on soft reset only. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* esp: use CamelCaseFunc for function typesBlue Swirl2010-02-071-4/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* ESP: improve IRQ debuggingBlue Swirl2010-01-161-0/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* scsi: move scsi-disk.h -> scsi.hGerd Hoffmann2009-11-091-1/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.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>
* sparc32 (mostly): remove unneeded calls to device resetBlue Swirl2009-11-071-2/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* esp: convert to reset + vmsdBlue Swirl2009-10-241-8/+16
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* New qdev_init_nofail()Markus Armbruster2009-10-071-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* switch scsi bus to inplace allocation.Gerd Hoffmann2009-10-051-5/+5
| | | | | 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-3/+3
| | | | | | | | | | | | 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-3/+3
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* ESP: convert to VMStateBlue Swirl2009-09-191-42/+22
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev/scsi: add scsi bus support to qdev, convert drivers.Gerd Hoffmann2009-09-091-40/+14
| | | | | | | | | | | | | | | | | | * Add SCSIBus. * Add SCSIDeviceInfo, move device callbacks here. * add qdev/scsi helper functions. * convert drivers. Adding scsi disks via -device works now, i.e. you can do: -drive id=sda,if=none,... -device lsi -device scsi-disk,drive=sda legacy command lines (-drive if=scsi,...) continue to work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* esp: handle "select without attention"Artyom Tarasenko2009-09-051-5/+23
| | | | | | | | | | | | | | | | | Up to now "select without attention" was handled the same way as "select with attention". According to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt select without ATN sends the CDB (Command Descriptor Block) directly, whereas select with ATN sends one message phase byte followed by 6, 10, or 12 command phase bytes. The attached patch implements the behaviour described above. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> [blauwirbel@gmail.com: cleaned up formatting] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* esp (sparc32) Extra scsi data.Artyom Tarasenko2009-08-311-1/+2
| | | | | | | | | | | | | | | | > ESP: Message Accepted (12) > ESP: Transfer status (sense=0) > ESP: read reg[5]: 0x20 > ESP: read reg[4]: 0x07 > ESP: read reg[7]: 0x02 > Extra scsi data. Fatal error. It looks like "Message Accepted" shouldn't write a response. At least ESP_RFLAGS must definetely be 0. With the following fix OBP goes one step further: Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: add return value to init() callbacks.Gerd Hoffmann2009-08-271-1/+2
| | | | | | | | | | | | | | | | | | 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-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* ESP: implement Transfer PadBlue Swirl2009-08-221-0/+7
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* ESP: Implement select without ATN, fix commentsBlue Swirl2009-08-221-2/+7
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Sparc32: move sparc32_dma init to sun4m.cBlue Swirl2009-08-081-0/+1
| | | | | | Also connect ESP and Lance reset signals to DMA. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* esp: fix interrupt register readBlue Swirl2009-07-311-4/+9
| | | | | | Read of interrupt register should clear it and also sequence step and status. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: rework device properties.Gerd Hoffmann2009-07-161-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | 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>
* Don't set IRQs on device reset and loadvm/savevmBlue Swirl2009-06-171-2/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove io_index argument from cpu_register_io_memory()Avi Kivity2009-06-161-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>
* Remove qdev irq sink handlingPaul Brook2009-05-261-1/+1
| | | | | | | 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>
* Introduce reset notifier orderJan Kiszka2009-05-221-1/+1
| | | | | | | | | | | | | | | 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>
* ESP SCSI qdev conversionPaul Brook2009-05-141-19/+42
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Replace gcc variadic macro extension with C99 versionBlue Swirl2009-05-131-5/+5
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-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
* Remove address maskingblueswir12008-12-021-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix ICCS command (Herve Poussineau)blueswir12008-11-301-0/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5818 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix 'enable selection' command (esp_4_ensel.diff)blueswir12008-11-291-0/+1
| | | | | | | | | Indicate success after 'enable selection' command Signed-off-by: Herve Poussineau <hpoussin@reactos.org> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5814 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix command len detection (esp_3_cmdlen.diff)blueswir12008-11-291-4/+4
| | | | | | | | | When command is not DMA, TCMID and TCLO registers are not filled. Use command buffer len instead Signed-off-by: Herve Poussineau <hpoussin@reactos.org> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5813 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix configuration 2 register (esp_2_cfg2.diff):blueswir12008-11-291-6/+1
| | | | | | | | | | According to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt, "Any bit pattern written to this register may be read back and should be identical" Signed-off-by: Herve Poussineau <hpoussin@reactos.org> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5812 c046a42c-6fe2-441c-8c8c-71466251a162
* Misc fixes (Herve Poussineau)blueswir12008-11-291-14/+21
| | | | | | | | | | | - Fix internal fifo size (16 bytes), according to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt - Fix values of STAT_MI and STAT_MO - Give a scsi ID to adapter, and prevent this ID to be used by devices - Prevent fifo overrun in esp_mem_writeb - Add a ESP_ERROR macro, and use it where appropriate git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5811 c046a42c-6fe2-441c-8c8c-71466251a162
* Resurrect the safe part of r5274blueswir12008-10-021-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5401 c046a42c-6fe2-441c-8c8c-71466251a162
* Sun ss20 OBP does 32bit register access to esp (Robert Reif)blueswir12008-10-021-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5394 c046a42c-6fe2-441c-8c8c-71466251a162
* Revert r5274 which breaks savevm/loadvmblueswir12008-09-251-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162
* Add signed versions of save/load functionsblueswir12008-09-201-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162
* Suppress OpenBSD warning messages for leftover fifo bytesblueswir12008-06-251-0/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4791 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix compilation warningblueswir12008-06-011-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4638 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix compiler warningsblueswir12008-05-101-6/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4404 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix irq handling (Hervé Poussineau)blueswir12008-04-241-15/+33
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4245 c046a42c-6fe2-441c-8c8c-71466251a162
* ESP: Add it_shift parameter (Hervé Poussineau)blueswir12008-04-091-7/+7
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4186 c046a42c-6fe2-441c-8c8c-71466251a162
* Let ESP SCSI adapter to be usable outside sun4m (Herv�oussineau)blueswir12008-03-021-8/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4007 c046a42c-6fe2-441c-8c8c-71466251a162
* Register only valid register access widthsblueswir12008-01-011-4/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3881 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud