Commit Graph

15 Commits

Author SHA1 Message Date
Grzegorz Bernacki
8e16e025ac Split raw reading/programming into smaller chunks to avoid allocating too
big chunk of kernel memory. Validate size of data. Add error handling to
avoid calling copyout() when data has not been read correctly.

Reviewed by:    zbb
Reported by:    x90c <geinblues@gmail.com>
MFC after:      2 days
2013-11-20 11:10:23 +00:00
Ian Lepore
774b082ca9 Rework the routine that returns a pointer to the table of software ECC
byte positions within the OOB area to support chips with unusual OOB
sizes such as 218 or 224 bytes.

The table for 128 byte OOB works for these but it assumes 3 bytes of ECC
per 256 byte block, and in the case of an ONFI chip the params page may
ask for something different.  In other words, this is better but not
yet perfect.
2013-11-15 23:48:51 +00:00
Ian Lepore
8fad47e60f Move the luns field to the end of the struct, for serendipitous packing.
(I was supposed to do this before committing it initially.)
2013-11-15 23:45:13 +00:00
Ian Lepore
c3c04faa3a ONFI parameters are little-endian, hence we must take care to convert them
to native endianness.  We must also pay attention to unaligned accesses.

Copy the interesting parameters to a new struct so the rest of the code can
forget about these problems.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:41:32 +00:00
Ian Lepore
1b45c6cd53 Search for and validate the ONFI params as specified in the standard.
The ONFI spec states that at least two bytes of the signature ("ONFI")
must be present, and the CRC must be correct to have a valid parameter
page.  If the page is not valid there are at least two backup pages where
the data can also be found.

Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:37:33 +00:00
Ian Lepore
7aa6428bc6 Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).
Submitted by:	Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig).
2013-11-15 23:35:10 +00:00
Ian Lepore
1337b92635 The vendor specified field is 88 bytes, not 8 bytes.
Submitted by:	Kristof Provost <kristof@sigsegv.be>
2013-11-15 23:31:39 +00:00
Ruslan Bukin
8a57d93d59 o Add ONFI signature check.
o Add Micron chip found in Freescale Vybrid Family
  Phytec COSMIC board.

Approved by:	cognet (mentor)
2013-11-09 18:46:11 +00:00
Alexander Motin
ce4bc82d19 Use direct custom implementations instead of g_handleattr() for CFI and NAND
d_getattr().  Since these drivers use disk(9) KPI and not directly GEOM, use
of that function means KPI layering violation, causing extra g_io_deliver()
call for the request.
2013-06-12 12:51:43 +00:00
Grzegorz Bernacki
0242992132 Fix ONFI chip detection.
Submitted by:	Alexander Fedorov <alexander.fedorov@rtlservice.com>
2013-05-27 06:24:31 +00:00
Ian Lepore
af66b223de Add the chip used in recent GlobalScale Technologies *Plug computers
Approved by:	cognet (mentor)
2013-01-27 00:16:36 +00:00
Konstantin Belousov
5050aa86cf Remove the support for using non-mpsafe filesystem modules.
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.

The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.

Conducted and reviewed by:	attilio
Tested by:	pho
2012-10-22 17:50:54 +00:00
Marcel Moolenaar
7c45c9e4b5 Add a driver for the Freescale FCM module in the localbus controller.
This driver does not yet handle multiple chip selects properly.

Note that the NAND infrastructure does not perform full page
reads or writes, which means that this driver cannot make use
of the hardware ECC that is otherwise present.
2012-07-03 01:00:29 +00:00
Takanori Watanabe
ab25c078af Add nand core module and module dependency information.
Reviewed by:gber
2012-06-26 18:08:03 +00:00
Grzegorz Bernacki
7f725bcd5c Import work done under project/nand (@235533) into head.
The NAND Flash environment consists of several distinct components:
  - NAND framework (drivers harness for NAND controllers and NAND chips)
  - NAND simulator (NANDsim)
  - NAND file system (NAND FS)
  - Companion tools and utilities
  - Documentation (manual pages)

This work is still experimental. Please use with caution.

Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-17 10:11:18 +00:00