Commit Graph

26 Commits

Author SHA1 Message Date
dim
373133f0ad Remove duplicate const specifiers in many drivers (I hope I got all of
them, please let me know if not).  Most of these are of the form:

static const struct bzzt_type {
	[...list of members...]
} const bzzt_devs[] = {
	[...list of initializers...]
};

The second const is unnecessary, as arrays cannot be modified anyway,
and if the elements are const, the whole thing is const automatically
(e.g. it is placed in .rodata).

I have verified this does not change the binary output of a full kernel
build (except for build timestamps embedded in the object files).

Reviewed by:	yongari, marius
MFC after:	1 week
2012-11-05 19:16:27 +00:00
ray
21e4b45182 Add more SPI flash IDs.
Submitted by:	Luiz Otavio O Souza.
Submitted by:	ZRouter.org project.
Approved by:	adrian (menthor)
2012-09-25 22:12:07 +00:00
adrian
7774cfc9ea Add a new flash part - 4MB SPI flash from Winbond. 2012-08-28 22:17:22 +00:00
marius
545343a302 Revert r236529, re-enabling verification of the flashed content as
the underlying problem was dealt with in r237239 (in fact, disabling
verification also actually only made the problem less likely to occur).
2012-06-18 20:19:07 +00:00
marius
f32938acd9 Disable verification of the flashed content for now; for reasons unknown
it sometimes causes physwr to hang.
2012-06-03 21:03:16 +00:00
marius
8573447bb6 - Loop up to 3 seconds when waiting for a device to get ready. [1]
- Make the device description match the driver name.
- Identify the chip variant based on the JEDEC and use that information
  to use the proper values for page count, offset and size instead of
  hardcoding a AT45DB642x with 2^N byte page support disabled.
- Take advantage of bioq_takefirst().
- Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned
  in Atmel's DataFlash Application Note, as suggested by the previous
  comment may not work on all all devices and actually doesn't properly
  on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use
  CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid
  out in a way allowing to easily add support for BIO_DELETE later on.
- Add support for reads and writes not starting on a page boundary.
- Verify the flash content after writing.
- Let at45d_task() gracefully handle errors on SPI transfers and the
  device not becoming ready afterwards again. [1]
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1]

Additional testing by:	Ian Lepore

Submitted by:	Ian Lepore [1]
MFC after:	1 week
2012-06-03 01:00:55 +00:00
adrian
3022368e00 Add a couple more SPI flash device IDs found in commercial
consumer wireless kit.

Submitted by:	Stefan Bethke <stb@lassitu.de>
2012-01-04 04:17:03 +00:00
adrian
65fe494e0a Modify the spi flash driver to allow smaller read IO sizes, but enforce
the larger, aligned write+erase sizes the driver currently implements.

This preserves write behaviour but makes the flash driver usable for things
like a read-only FFS or a geom_uzip/geom_compress .

Note that since GEOM will now return the sector size as being smaller,
writes of sector size/alignment will now fail with an EIO. Code which
writes to the flash device will have to be (for now) manually taught
about the flash write blocksize.
2011-02-16 20:07:44 +00:00
adrian
f4f409cce3 Add support for the m25p64; lifted straight from Linux.
This flash chip is found on the Ubiquiti LS-SR71 board.
I've successfully tested reading; I've not tried writing to it yet.
2011-01-30 12:14:06 +00:00
adrian
1e41807d30 Add s25sl064a, an 8mb SPI flash part. 2010-08-17 16:27:13 +00:00
adrian
4dc0d673ed Fix naming to be consistent. 2010-07-19 21:50:43 +00:00
adrian
ed5801ffc7 Extend the mx25l erase function to support different erase commands. 2010-07-19 21:46:40 +00:00
adrian
18aed410d7 Extend the mx25l flash device support to include a set of per-device
flags.

Some of these parts will support 4K/32K block erases rather than
a sector erase. This includes (at least) the MX25L128.
2010-07-19 21:38:15 +00:00
adrian
2ad116091d Include 4k/32k erase commands.
These were sourced from the MX25L128 datasheet and match up
with what is used in Linux mtd/devices/m25p80.c .

Add a FreeBSD keyword whilst I'm here.
2010-07-19 15:05:35 +00:00
adrian
b86c5f716a Fix KASSERT() messages to reflect reality. 2010-07-16 04:26:37 +00:00
gonzo
79f6f583f5 - Code reorg: extract mx25l_read and mx25l_write methods
- Add entry for Spansion flash controller
    Submitted by: Eric L. Chen <lihong@ieee.org>
2009-11-18 22:14:36 +00:00
gonzo
7f3b095543 - Add write support for mx25l flash chip
- Some minor style(9) fixes
2009-10-25 08:43:38 +00:00
imp
aad4ef3f7d o Move the driveid.h file
o lots of tweaks to header paths.
o comment out SMP for the moment

# we now make it through the .c make depend, the .s needs more work.
2009-06-14 04:26:56 +00:00
imp
0522d0af0d Part of the cf driver missed. 2009-06-14 04:16:58 +00:00
imp
ea2c1567fc Move dev/flash/ cf driver into octeon dir where it belongs. 2009-06-14 03:55:27 +00:00
imp
b507305dcb Merge in Cavium's CF driver. This too is in the wrong place and will
be moved.
2009-06-14 03:47:44 +00:00
gonzo
fc666881e7 Merge from HEAD 2009-05-26 17:01:12 +00:00
gonzo
139c4bb3e7 - Add support for MX25Lxxx SPI flash (readonly atm) 2009-05-18 23:20:56 +00:00
gonzo
ec81c49a42 - Remove nonexistent header file from includes list 2009-05-13 18:31:28 +00:00
julian
51d643caa6 Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.
2007-10-20 23:23:23 +00:00
imp
f8717ce4d7 MFp4:
Preliminary support for Atmel AT45D series of DataFlash on the
	SPI bus (ok, not really a hardware bus, but a logical
	connection).  This works only for the 8MB version of the part
	due to hard coding.  Both read and write are supported.
2006-11-29 08:05:55 +00:00