Commit Graph

298 Commits

Author SHA1 Message Date
Jussi Kivilinna
7b8df1b930 mtd/w25: wait for BUSY flag to clear in w25_readid and w25_unprotect. W25Q128 datasheet says that all instructions expect 'Read Status Register' and 'Erase/Program Suspend' are ignored when BUSY flag in status register is '1'. Therefore wait for busy flag to clear in w25_readid() and w25_unprotect(). 2017-06-13 07:35:49 -06:00
Jussi Kivilinna
2596b14c90 mtd/w25: add missing locking and fix SPI_SELECT usage for w25_unprotect 2017-06-13 07:33:34 -06:00
Gregory Nutt
0a85a41678 MTD FLASH driver: Clone Sebastien Lorquet's m25px change to at25, is25xp, ramtron, and sst25xx. 2017-06-12 09:51:42 -06:00
Sebastien Lorquet
2851959dee MTD M2PX: If we READ while a write/erase is pending, the command is ignored and the write/erase continues. If we dont catch this situation we will return garbage to the user because the flash will not execute the command. So READ MUST wait for write completion, and before that, the bus must be locked since it's a precondition to calling waitwritecomplete(). 2017-06-12 09:34:09 -06:00
Gregory Nutt
d35a060a41 Revert "MTD: Fix problems in SPI locking in mp25x.c driver. Same problem probably in exists in several other drivers that derive from this this driver as well."
This reverts commit 85645284b3.
2017-06-12 07:23:06 -06:00
Sebastien Lorquet
85645284b3 MTD: Fix problems in SPI locking in mp25x.c driver. Same problem probably in exists in several other drivers that derive from this this driver as well. 2017-06-12 06:38:27 -06:00
Gregory Nutt
670d6a1e8d MTD FLASH drivers: The byte write method of several drivers had a cloned error: It was not locking the bus while performing byte write operations. 2017-06-06 16:10:41 -06:00
Juha Niskanen
06edfae133 mtd/config: Add some error checks for I/O errors 2017-06-01 06:22:27 -06:00
Jussi Kivilinna
7af5cbb833 drivers/mtd/w25.c: Enable short delay after sector/chip erase 2017-05-31 09:17:58 -06:00
Jussi Kivilinna
8b006e705e drivers/mtd/w25.c: erase sector only if it is not in erased state 2017-05-31 09:09:24 -06:00
Jussi Kivilinna
c7fcdf968d mtd/smart: Fix use of uninitialized variable 2017-05-31 09:07:25 -06:00
Gregory Nutt
0de294a586 Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
Juha Niskanen
0f7210b0ae mtd: fix some unallocated and NULL pointer issues. rwb->wrflush and rwb->wrmaxblocks in rwbuffer could get unallocated values from ftl_initialize() in some configurations. Also fixes related assert:
up_assert: Assertion failed at file:rwbuffer.c line: 643

that can happen with the following configuration:

  CONFIG_FTL_WRITEBUFFER=y
  CONFIG_DRVR_WRITEBUFFER=y
  # CONFIG_FS_WRITABLE is not set

These problems are caused by CONFIG variable differences between the buffer layers. TODO: This is not a perfect solution. readahead support has similar issues.
2017-05-11 07:22:21 -06:00
Juha Niskanen
58a0b09b82 mtd/config: fix byte read interface test 2017-05-11 07:19:24 -06:00
Juha Niskanen
797e3c3ca4 mtd: build RAMTRON and AT45DB drivers only if selected 2017-05-11 07:17:29 -06:00
Juha Niskanen
4f18b40429 mtd/config: erase block between block read and write 2017-05-10 08:25:39 -06:00
Gregory Nutt
e9a5477506 Add an instance argument to the SPIDEV definitions. 2017-04-29 12:26:52 -06:00
Heesub Shin
a10735b50d mtd/progmem: fix incorrect target address calculation
progmem_read/write() is incorrectly calculating the target address,
expecting the offset argument is given in a block number. This is
completely wrong and as a result invalid flash region is accessed.
Byte-oriented read/write interfaces of mtd device accept the
target address in a byte offset, not a block number.

Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
2017-03-19 01:11:37 +09:00
Gregory Nutt
a70ea9d3bc Typos withim mtd/ with Macronix MX25L. In NuttX/drivers/mtd/Make.defs letters X between M and 25 are missing. Noted by Oleg Evseev. 2017-01-30 07:26:38 -06:00
Gregory Nutt
5e0c18b535 Merged in david_s5/nuttx/upstream_2_greg_ramtron (pull request #198)
Adding missing CONFIG_ prefix
2017-01-20 20:48:22 +00:00
David Sidrane
ca895b978b Adding missing CONFIG_ prefix 2017-01-20 10:45:50 -10:00
Gregory Nutt
08c001196b drivers/: Remove all explicit use of 'hidden' macro _info. Code must never use this directly. Code must always use a debug macro such as info which is basic on _info but can be appropriately filtered. 2017-01-15 13:00:50 -06:00
Aleksandr Vyhovanec
bf528f2071 packed_struct replaced by begin_packed_struct and end_packed_struct 2017-01-09 14:17:49 +03:00
Gregory Nutt
1793c1f8e1 Trivial, cosmetic change 2016-11-29 15:03:51 -06:00
Gregory Nutt
8dd2494407 Review of last PR: Fix return value (ERROR is not a value return value in this context). Fix some spacing. 2016-11-01 15:13:09 -06:00
Aleksandr Vyhovanec
be1626ad7b Added EEPROM timeout 2016-11-02 00:03:16 +03:00
Aleksandr Vyhovanec
b0f973d901 MTD: SPI-based driver for Macronix MX25L3233F or MX25L6433F. 2016-09-02 11:00:04 -06:00
Aleksandr Vyhovanec
3f40541b21 MTD: Fixed cloned typos in several FLASH drivers. 2016-09-02 07:27:57 -06:00
Beat Küng
dd1f679891 mtd: Add Fujistu MB85RS256B ramtron support
contributed by flatlevel from https://github.com/PX4/NuttX/pull/79
2016-08-23 18:27:04 +00:00
Gregory Nutt
9965cbe428 drivers/: Review and correct some stylistic inconsistencies 2016-08-07 09:43:48 -06:00
Gregory Nutt
10fff9011a Move include/nuttx/configdata.h to include/nuttx/mtd/configdata.h 2016-07-21 13:34:54 -06:00
Gregory Nutt
46dbbe837e rwbuffer.h moved from include/nuttx/ to include/nuttx/drivers. 2016-07-20 13:54:38 -06:00
Ken Pettit
39174da3be Remove naming conflict in drivers/mtd/filemntd.c 2016-07-17 20:19:44 -06:00
Ken Pettit
fea2aaba05 SMART MTD layer: Fixes freesector logic error when sectorsPerBlk=256, adds DEBUGASSERT for invalid geometry and additional memory debug logic. Also fixes the dangling pointer on error bug. 2016-07-14 10:31:28 -06:00
Gregory Nutt
74037a7951 Merged in ziggurat29/nuttx/stm32l4_smartfs_test (pull request #97)
fixes to n25qxxx mtd driver for smartfs support, etc...
2016-07-12 12:16:13 -06:00
ziggurat29
74777499bc alter the notion of 'blocksize' to be equivalent to 'flash write page size' in order to align with assumptions in the smartfs driver (at least, maybe other things do as well).
Correct a bug that was previously masked by having blocksize=eraseblocksize which would cause buffer overflows and delicious hardfaults.
Trivial spelling changes in comments, etc.
2016-07-12 11:46:08 -05:00
Sebastien Lorquet
0d41a1cd42 Before accessing the sst26 flash, the "Global Unlock" command must me executed, which I do in the sst26 driver.
BUT. re-reading the datasheet, the WREN instruction is required to enable the execution of this command. This was not done.

I have no idea how the driver currently works except by chance. The writes
should never happen at all, the flash is half-enabled!
2016-07-12 10:34:03 -06:00
Gregory Nutt
5b6fafb3f5 Several MTD FLASH drivers nullify the freed 'priv' structure and failed to return NULL as stated in the comments. Result, will operate on a NULL pointer later. Noted by David Sidrane. 2016-06-30 17:49:53 -06:00
Gregory Nutt
43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt
0c8c7fecf0 Add _ to the beginning of all debug macros to avoid name collisions 2016-06-16 12:33:32 -06:00
Gregory Nutt
efb02f2ef1 drivers/: Change some nerr() ERRORS to nwarn() WARNINGS. Anomolous network evernts are not errors. 2016-06-12 08:31:22 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
3a74a438d9 Rename CONFIG_DEBUG_VERBOSE to CONFIG_DEBUG_INFO 2016-06-11 11:50:18 -06:00
Gregory Nutt
5f9bcfd5bf Trivial changes from review of last PR 2016-06-09 09:36:06 -06:00
Gregory Nutt
03c44c3583 Merged in marten_svanfeldt/nuttx-public/for_upstream/is25 (pull request #44)
Added driver of IS25xP SPI flash devices
2016-06-09 09:30:34 -06:00
Marten Svanfeldt
edeb2eed4e Added driver of IS25xP SPI flash devices
Based on sst25xx driver

Signed-off-by: Marten Svanfeldt <marten@intuitiveaerial.com>
2016-06-09 05:13:06 +02:00
Gregory Nutt
a18dbfda6e Remove drivers/mtd/flash_eraseall.c. It is not used in the OS and is just a dumb wrapper around the MDIOC_BULKERASE IOCTL call. 2016-06-02 10:44:13 -06:00