summaryrefslogtreecommitdiffstats
path: root/hw/pflash_cfi01.c
Commit message (Collapse)AuthorAgeFilesLines
* sysbus: Drop sysbus_from_qdev() cast macroAndreas Färber2013-01-211-1/+1
| | | | | | | | | | | Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion. Avoids the old macro creeping into new code. Resolve a Coding Style warning in openpic code. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pflash_cfi01: Suppress warning when Linux probes for AMD flashStefan Weil2013-01-011-0/+3
| | | | | | | | | | | | | | | | There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory. The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation: pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0) pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0) These warnings confuse users, so suppress them. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Merge remote-tracking branch 'bonzini/header-dirs' into stagingAnthony Liguori2012-12-191-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bonzini/header-dirs: (45 commits) janitor: move remaining public headers to include/ hw: move executable format header files to hw/ fpu: move public header file to include/fpu softmmu: move remaining include files to include/ subdirectories softmmu: move include files to include/sysemu/ misc: move include files to include/qemu/ qom: move include files to include/qom/ migration: move include files to include/migration/ monitor: move include files to include/monitor/ exec: move include files to include/exec/ block: move include files to include/block/ qapi: move include files to include/qobject/ janitor: add guards to headers qapi: make struct Visitor opaque qapi: remove qapi/qapi-types-core.h qapi: move inclusions of qemu-common.h from headers to .c files ui: move files to ui/ and include/ui/ qemu-ga: move qemu-ga files to qga/ net: reorganize headers net: move net.c to net/ ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * exec: move include files to include/exec/Paolo Bonzini2012-12-191-1/+1
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * block: move include files to include/block/Paolo Bonzini2012-12-191-1/+1
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | pflash_cfi0x: Send debug messages to stderrPeter Crosthwaite2012-12-181-4/+4
| | | | | | | | | | | | | | | | These debug info messages should go to stderr rather than stdout. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | pflash_cfi01: qemu_log_mask "unimplemented" msgPeter Crosthwaite2012-12-181-3/+3
|/ | | | | | | | | This printf is informing the user of unimplemented functionality. It should be re-directed to qemu_log(LOG_UNIMP, ...) accordingly. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* pflash_cfi01: Fix debug mode printferyPeter Crosthwaite2012-10-301-1/+2
| | | | | | | | This DPRINTF was throwing a warning due to a missing cast. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* pflash_cfi0x: QOMifiedPeter Crosthwaite2012-10-301-41/+100
| | | | | | | | | | | QOMified the pflash_cfi0x so machine models can connect them up in custom ways. Kept the pflash_cfi0x_register functions as is. They can still be used to create a flash straight onto system memory. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* pflash_cfi01: remove unused total_len fieldPeter Crosthwaite2012-10-301-2/+0
| | | | | | | | This field is completely unused. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* pflash_cfi0x: remove unused base fieldPeter Crosthwaite2012-10-301-2/+0
| | | | | | | | | This field is completely unused. The base address should also be abstracted away from the device anyway. Removed. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-24/+24
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* cleanup useless return sentenceAmos Kong2012-10-051-1/+0
| | | | | | | | This patch cleans up return sentences in the end of void functions. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* pflash_cfi01: Fix warning caused by unreachable codeStefan Weil2012-09-231-4/+4
| | | | | | | | | | | | | Report from smatch: hw/pflash_cfi01.c:431 pflash_write(180) info: ignoring unreachable code. Instead of removing the return statement after the switch statement, the patch replaces the return statements in the switch statement by break statements. Other switch statements in the same code do it also like that. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* hw/pflash_cfi0[12]: Use host-utils.h ctz32()Peter Maydell2012-09-191-36/+1
| | | | | | | | | Drop the private reimplementation of ctz32() from pflash_cfi0[12] in favour of using the standard version from host-utils.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* pflash_cfi01: fix vendor specific extended queryAurelien Jarno2012-09-191-1/+3
| | | | | | | | | | | | | | | pflash_cfi01 announces a version number of 1.1, which implies "Protection Register Information" and "Burst Read information" sections, which are not provided. Decrease the version number to 1.0 so that only the "Protection Register Information" section is needed. Set the number of protection fields (0x3f) to 0x01, as 0x00 means 256 protections field, which makes the CFI table bigger than the current implementation, causing some kernels to fail to read it. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* pflash_cfi01: remove redundant lineEric Bénard2012-04-201-1/+0
| | | | | | Signed-off-by: Eric Bénard <eric@eukrea.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* pflash_cfi01/02: support read-only pflash devicesJordan Justen2012-02-221-14/+30
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vmstate, memory: decouple vmstate from memory APIAvi Kivity2012-01-041-1/+3
| | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-09-081-0/+1
|\
| * block: Attach non-qdev devices as wellMarkus Armbruster2011-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | For now, this just protects against programming errors like having the same drive back multiple non-qdev devices, or untimely bdrv_delete(). Later commits will add other interesting uses. While there, rename BlockDriverState member peer to dev, bdrv_attach() to bdrv_attach_dev(), bdrv_detach() to bdrv_detach_dev(), and bdrv_get_attached() to bdrv_get_attached_dev(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | pflash_cfi01/pflash_cfi02: convert to memory APIAvi Kivity2011-09-041-45/+33
|/ | | | | | | | | | | 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>
* Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"Anthony Liguori2011-08-251-23/+44
| | | | | | | | | | | | 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>
* pflash_cfi01/pflash_cfi02: convert to memory APIAvi Kivity2011-08-251-44/+23
| | | | | | | | 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>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-2/+2
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Add endianness as io mem parameterAlexander Graf2010-12-111-2/+4
| | | | | | | | | | | | | 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>
* pflash_cfi01: add device ID read commandMichael Walle2010-05-211-0/+20
| | | | | | | | Add support to read manufacturer and device ID. For everything else (eg. lock bits) 0 is returned. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* arm: remove dead assignments, spotted by clang analyzerBlue Swirl2010-04-251-0/+2
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pflash_cfi01 only onceBlue Swirl2010-03-291-68/+127
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pflash: Buffer block writesEdgar E. Iglesias2010-01-271-3/+9
| | | | | | | | Buffer block writes to avoid flushing every word access onto backing storage device. This significantly speeds up flash emulation for flashes connected through an 8 or 16-bit bus combined with backing storage (-pflash). Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
* pflash: Dont open memarea for full IO if already done.Edgar E. Iglesias2010-01-241-2/+4
| | | | | | | | | When wcycle is non zero the area is already opened for readable IO. Avoiding the re-registration of the memarea significantly speeds up the flash emulation. In particular for flashes connected through 8 or 16-bit buses. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
* pflash: Reduce writebuf len for 8-bit flashes.Edgar E. Iglesias2010-01-241-1/+5
| | | | | | | Flashes connected through an 8 bit bus cannot handle write buffers larger than 256 bytes. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
* pflash: Remove dead code, no functional changes.Edgar E. Iglesias2010-01-241-7/+0
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-27/+27
| | | | | | | | | | | | 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-27/+27
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* static and inline should came before the type of the functionsJuan Quintela2009-09-251-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pflash_cfi01: Correct debug build, no functional changes.Edgar E. Iglesias2009-09-141-11/+12
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Check block driver read error in pflash_cfi0xVijay Kumar2009-08-271-1/+7
| | | | | | | | | | | | | If a flash file of size smaller than the flash size is specified in the -pflash option, the block driver returns error. But the pflash_cfi0x ignores the error. This results in a flash content of all zeroes. And the simulation aborts while executing code. This patch adds the checks for errors from bdrv_read and escalates it to the calling code. Signed-off-by: Vijay Kumar B. <vijaykumar@bravegnu.org> 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>
* Update to a hopefully more future proof FSF addressBlue Swirl2009-07-161-2/+1
| | | | 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>
* Replace gcc variadic macro extension with C99 versionBlue Swirl2009-05-131-5/+5
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use target_phys_addr_t, not target_ulong.Paul Brook2009-05-081-12/+13
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Yet more phys_ram_base elimination.pbrook2009-04-101-1/+2
| | | | | | | Signed-off-by: Paul Brook <paul@cofdesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7067 c046a42c-6fe2-441c-8c8c-71466251a162
* 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
* Update FSF address in GPL/LGPL boilerplateaurel322009-01-041-1/+1
| | | | | | | | | | The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
* pflash_cfi01: add Single Byte Program (Jean-Christophe PLAGNIOL-VILLARD).balrog2008-12-071-34/+53
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5904 c046a42c-6fe2-441c-8c8c-71466251a162
* Change MMIO callbacks to use offsets, not absolute addresses.pbrook2008-12-011-2/+0
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud