aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/nand
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-102-2/+2
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* No need to test command values this way. There can be only one, evenWarner Losh2015-12-182-13/+13
| | | | | | | though the encoding is bit-wise today... Notes: svn path=/head/; revision=292428
* Remove one more that crept in unnecessarily from previous commit.Justin Hibbits2015-08-051-1/+0
| | | | Notes: svn path=/head/; revision=286299
* Remove some unnecessary includes.Justin Hibbits2015-08-051-5/+1
| | | | Notes: svn path=/head/; revision=286298
* Use the correct le*dec function to decode a 16bit type.Christian Brueffer2015-07-011-1/+1
| | | | | | | | | PR: 194228 Submitted by: David Horwitt MFC after: 2 weeks Notes: svn path=/head/; revision=285006
* Map the LAW for the RouterBoard's NAND LBC memory.Justin Hibbits2015-06-061-0/+12
| | | | | | | | | | | | | | | | | | | Without creating a LAW entry, any access to the NAND hangs the CPU. The original intent was to add a quirk to map all of the RouterBoard's LBC address space in one shot, which would fix it for both NAND and the CF, and that's probably still in the cards. However, for now, this makes NAND usable without a separate hack. Things left before the RouterBoard can run standalone: * Add partitions to the NAND (not specified by the FDT, which we currently require). * Create a YAFFS partition for the kernel. The Mikrotik boot loader requires a 4MB partition at the beginning of NAND, with a file called 'kernel' in the root. Notes: svn path=/head/; revision=284083
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-1/+1
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Implement a driver for the PowerPC-base RouterBoard (RB333/600/800/1100)Justin Hibbits2015-05-041-0/+275
| | | | | | | | | | | | | | | | | | | Summary: This has been tested on the RB800, but should work on the RB333, RB600, and RB1100 as well. It's currently missing ECC support, but read and write are complete. Reviewers: imp Reviewed By: imp Subscribers: imp Differential Revision: https://reviews.freebsd.org/D2223 Notes: svn path=/head/; revision=282430
* machine/fdt.h no longer exists for powerpc.Justin Hibbits2015-03-311-1/+0
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=280891
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-10/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+10
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Add fdt binding for nand for Atmel parts. This does little more thanWarner Losh2014-02-281-2/+17
| | | | | | | | | match the device. Pinctrl will need to be added before this will work, in addition to migrating the current board_foo.c method of configuring these pins to something else. Non-FDT systems won't be affected, yet. Notes: svn path=/head/; revision=262597
* Correct the order of arguments to mtx_init().Christian Brueffer2014-02-141-1/+1
| | | | | | | | | PR: 186701 Submitted by: Takanori Sawada <tak.swd at gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=261884
* Generalize AT91 NAND support a bit. Be more flexible about ALE and CLEWarner Losh2014-01-192-11/+81
| | | | | | | address line assignment. Provide convenince function to set these things. Notes: svn path=/head/; revision=260885
* More NAND IDs of some really old Samsung parts, also list the partWarner Losh2014-01-041-7/+7
| | | | | | | number that we're matching... Notes: svn path=/head/; revision=260296
* Fill in some more info about the (somewhat old) Samsung parts I haveWarner Losh2014-01-031-4/+4
| | | | | | | here... Notes: svn path=/head/; revision=260214
* The HOT-E HL201 has 128MB Samsung SLC NAND, ID it properly.Warner Losh2014-01-031-0/+2
| | | | Notes: svn path=/head/; revision=260212
* Make the comment match the code. Not sure why we calculate it thisWarner Losh2014-01-021-1/+1
| | | | | | | weird way, but didn't change that... Notes: svn path=/head/; revision=260180
* Add support for Samsung K9F2G08U0A (256MiB SLC) NAND found on some oldWarner Losh2013-12-311-0/+2
| | | | | | | | | | | | | Atmel boards I have. # All Samsung, Toshiba and SanDisk parts will need to be in this table # since they don't conform to the ONFI specification (they are all Toggle # parts). There's some standards for the additional bytes so there's some hope # to decode them automatically on a per-vendor basis, but even that has # problems (and is what motivated the ONFI parameter page). Notes: svn path=/head/; revision=260121
* Add a nand flash controller driver for Atmel at91 family. Tested onlyIan Lepore2013-12-021-0/+258
| | | | | | | | | on at91rm9200 so far. The files.at91 has listed a nand driver for ages, but it never existed. Notes: svn path=/head/; revision=258828
* Look up a nand chip by id in the static table before trying to obtainIan Lepore2013-11-291-11/+21
| | | | | | | | ONFI parameters. This allows a static table entry to provide valid data for chips known to provide invalid ONFI data. Notes: svn path=/head/; revision=258740
* Unbreak compilation with GCC.Grzegorz Bernacki2013-11-212-2/+4
| | | | Notes: svn path=/head/; revision=258425
* Split raw reading/programming into smaller chunks to avoid allocating tooGrzegorz Bernacki2013-11-202-18/+100
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=258387
* Rework the routine that returns a pointer to the table of software ECCIan Lepore2013-11-151-17/+16
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=258202
* Move the luns field to the end of the struct, for serendipitous packing.Ian Lepore2013-11-151-1/+1
| | | | | | | (I was supposed to do this before committing it initially.) Notes: svn path=/head/; revision=258201
* ONFI parameters are little-endian, hence we must take care to convert themIan Lepore2013-11-153-21/+48
| | | | | | | | | | | | 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). Notes: svn path=/head/; revision=258200
* Search for and validate the ONFI params as specified in the standard.Ian Lepore2013-11-151-9/+46
| | | | | | | | | | | | 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). Notes: svn path=/head/; revision=258199
* Update the onfi_params struct to ONFI revision 3.2 (06 12 2013).Ian Lepore2013-11-151-5/+16
| | | | | | | Submitted by: Kristof Provost <kristof@sigsegv.be> (cleanup) and me (orig). Notes: svn path=/head/; revision=258197
* The vendor specified field is 88 bytes, not 8 bytes.Ian Lepore2013-11-151-1/+3
| | | | | | | Submitted by: Kristof Provost <kristof@sigsegv.be> Notes: svn path=/head/; revision=258196
* o Add ONFI signature check.Ruslan Bukin2013-11-093-2/+9
| | | | | | | | | | o Add Micron chip found in Freescale Vybrid Family Phytec COSMIC board. Approved by: cognet (mentor) Notes: svn path=/head/; revision=257892
* Use direct custom implementations instead of g_handleattr() for CFI and NANDAlexander Motin2013-06-121-16/+20
| | | | | | | | | 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. Notes: svn path=/head/; revision=251651
* Fix ONFI chip detection.Grzegorz Bernacki2013-05-272-2/+2
| | | | | | | Submitted by: Alexander Fedorov <alexander.fedorov@rtlservice.com> Notes: svn path=/head/; revision=251022
* Add the chip used in recent GlobalScale Technologies *Plug computersIan Lepore2013-01-271-0/+2
| | | | | | | Approved by: cognet (mentor) Notes: svn path=/head/; revision=245953
* Remove the support for using non-mpsafe filesystem modules.Konstantin Belousov2012-10-221-10/+2
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=241896
* Add a driver for the Freescale FCM module in the localbus controller.Marcel Moolenaar2012-07-032-0/+813
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=238046
* Add nand core module and module dependency information.Takanori Watanabe2012-06-262-0/+4
| | | | | | | Reviewed by:gber Notes: svn path=/head/; revision=237605
* Import work done under project/nand (@235533) into head.Grzegorz Bernacki2012-05-1724-0/+8078
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 Notes: svn path=/head/; revision=235537