aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cfi/cfi_core.c
Commit message (Collapse)AuthorAgeFilesLines
* cfi: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-3/+1
| | | | Notes: svn path=/head/; revision=365217
* Fix AMD type flash write operations, and display chip information at bootAllan Jude2019-03-241-6/+94
| | | | | | | | | | | Applies to MX flash chips on AR9132 and RT3050 Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: imp, sbruno Differential Revision: https://reviews.freebsd.org/D14279 Notes: svn path=/head/; revision=345464
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
* [cfi] fix CFI flash reset command for MX29LV320T/B.Adrian Chadd2017-05-061-2/+13
| | | | | | | | | | | MX flash MX29LV320T/B datasheet say reset is 0xf0. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Approved by: mizhka Differential Revision: https://reviews.freebsd.org/D10177 Notes: svn path=/head/; revision=317865
* Provide a workaround for setting the correct endianness when doing CFI onAdrian Chadd2016-02-041-0/+15
| | | | | | | | | | | | | | | | a mips big-endian board. This is (hopefully! ish!) a temporary change until a slightly better way can be found to express this without a config option. Tested: * BUFFALO WZR-HP-G300NH 1stGen (by submitter) Submitted by: Mori Hiroki <yamori813@yahoo.co.jp> Notes: svn path=/head/; revision=295284
* Follow up to r225617. In order to maximize the re-usability of kernel codeDavide Italiano2014-10-161-1/+1
| | | | | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe Notes: svn path=/head/; revision=273174
* MFP4: 1136252Brooks Davis2013-10-181-0/+4
| | | | | | | | | | | Add an option ATSE_CFI_HACK to allow memory mapped CFI devices to have their address range allocated sharable so that atse(4) can find it's Ethernet address in the expected location. We intend to remove this hack once the BERI platform has a loader. Notes: svn path=/head/; revision=256753
* MFP4 217312, 222008, 222052, 222053, 222673, 231484, 231491, 231565, 570643Brooks Davis2013-09-041-42/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the timeout code to use actual time rather than a DELAY() loop and to use both typical and maximum to allow logging of timeout failures. Also correct the erase timeout, it is specified in milliseconds not microseconds like the other timeouts. Do not invoke DELAY() between status queries as this adds significant latency which in turn reduced write performance substantially. Sanity check timeout values from the hardware. Implement support for buffered writes (only enabled on Intel/Sharp parts for now). This yields an order of magnitude speedup on the 64MB Intel StrataFlash parts we use. When making a copy of the block to modify, also keep a clean copy around until we are ready to commit the block and use it to avoid unnecessary erases. In the non-buffer write case, also use it to avoid unnecessary writes when the block has not been erased. This yields a significant speedup when doing things like zeroing a block. Sponsored by: DARPA, AFRL Reviewed by: imp (previous version) Notes: svn path=/head/; revision=255207
* MFP4 @217311Brooks Davis2013-05-301-0/+20
| | | | | | | | | Intel and Sharp flash power on with their blocks in a "locked" state. Unlocked them before attempting to perform an erase or write action and relock when the action is complete. Notes: svn path=/head/; revision=251118
* MFP4 change 222060:Brooks Davis2013-04-301-0/+19
| | | | | | | | | | On Intel devices, put the Factory PPR in kenv. On some FPGA boards it may be the only software accessable unique ID. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=250115
* CFI fixes for big endian archs.Jayachandran C.2012-03-271-3/+30
| | | | | | | | | | | | | The flash commands and responses are little-endian and have to be byte swapped on big-endian systems. However the raw read of data need not be swapped. Make the cfi_read and cfi_write do the swapping, and provide a cfi_read_raw which does not byte swap for reading data from flash. Notes: svn path=/head/; revision=233553
* Move from using devclass_find_free_unit(cfi_diskclass, 0) to -1, sinceWarner Losh2009-06-101-2/+1
| | | | | | | they have the same basic behavior. Notes: svn path=/head/; revision=193936
* Add cfid, a disk interface to CFI flash devices; this enables constructionSam Leffler2009-03-091-0/+5
| | | | | | | | | of flash-based filesystems. Note this is not interlocked against the raw CFI device. Notes: svn path=/head/; revision=189606
* fix typoSam Leffler2009-02-081-1/+1
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=188332
* fix building w/o CFI_ARMEDANDDANGEROUSSam Leffler2009-02-071-4/+5
| | | | Notes: svn path=/head/; revision=188268
* expand CFI_ARMEDANDDANGEROUS to include writing the user segmentSam Leffler2009-02-071-3/+12
| | | | | | | | of the PR; this register is actually write-once so deserves the safety-belt as much as the PLR Notes: svn path=/head/; revision=188267
* Add support for frobbing Intel StrataFlash Protection Registers:Sam Leffler2009-02-051-13/+162
| | | | | | | | | | | | | | | | | o add CFI_SUPPORT_STRATAFLASH compile option to enable support o add new ioctls to get/set the factory and user/oem segments of the PR and to get/set Protection Lock Register that fuses the user segment o add #defines for bits in the status register o update cfi_wait_ready to take an offset so it can be used to wait for PR write completion and replace constants w/ symbolic names Note: writing the user segment isn't correct; committing now to get review. Sponsored by: Carlson Wireless Reviewed by: imp, Chris Anderson Notes: svn path=/head/; revision=188156
* honor any interface width (e.g. setup by the bus shim) and don't probe;Sam Leffler2009-02-031-5/+10
| | | | | | | this is needed for the moment to workaround bus shim issues Notes: svn path=/head/; revision=188087
* Add a driver for flash memory that implements to the Common FlashMarcel Moolenaar2008-10-251-0/+419
Memory Interface (CFI). The flash memory can be read and written to through /dev/cfi# and an ioctl() exists so processes can read the query information. The driver supports the AMD and Intel command set, though only the AMD command has been tested. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=184251