Commit Graph

327 Commits

Author SHA1 Message Date
Gregory Nutt
8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Michał Łyszczek
249d7e0d84 drivers/mtd/mtd_config.c: mtdconfig_register() returned OK intead of -ENOMEM on failed malloc 2018-05-08 06:48:00 -06:00
Michael Jung
121211f096 progmem interface: Discern r/w and erase page sizes. Introduce new up_progmem_erasesize architecture API to be able to communicate the read/write page size independently from erase page size. Implement up_progmem_erasesize for all architectures that already support progmem, assuming that for those architectures the sizes of both read/write and erase pages are identical. 2018-05-01 06:23:52 -06:00
lihaichen
a71aa070e7 Merged in lihaichen/nuttx_fix_w25 (pull request #623)
fix w25_cacheflush sector bug.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-04 17:04:23 +00:00
Gregory Nutt
987a8298f2 Fix some errors found in build testing + clean-up some issues with last changes to remove use of printf() from within the OS. 2018-03-03 15:51:27 -06:00
Gregory Nutt
b4f2b0dfc6 Remove all usage of printf() from the OS. That is not an acceptable context for the use of an application-oriented interface that depends on a task-specific file descriptor and C buffered I/O. 2018-03-03 15:20:21 -06:00
Gregory Nutt
d1b31d536a Eliminate a couple more uses of printf() within the OS. There are several more. 2018-03-03 12:59:48 -06:00
Dmitriy Linikov
a8c58607e9 Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603)
Added ECANCELED condition to DEBUGASSERT-s checking sem_wait result

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-20 18:24:53 +00:00
Gregory Nutt
8572837d9e Squashed commit of the following:
Author: Juha Niskanen <juha.niskanen@haltian.com>
Date:   Mon Feb 19 15:03:17 2018 -0600

    drivers/mtd:  mtd_config.c:  Add still more error handling (to detect bad underlying flash implementations)
    drivers/mtd:  mtd_config.c:  Remove MTD_ERASE that was erasing data block instead of erase block.  This is a partial revert of 4f18b4.  Reported-by: Pascal Speck <iktek01@yahoo.com>
    arch/arm/src/stm32l4:  stm32l4_flash: change flash programming to use page buffer for unaligned writes.
2018-02-19 15:03:47 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Alexander Oryshchenko
a7834bcb7b drivers/mtd/at24xx.c: Correct page size for AT24C02 part. 2018-01-24 06:51:34 -06:00
Ekaterina Kovylova
59a5c24739 drivers/mtd: Add a driver for Macronix MX35LFxGE4AB serial NAND flash. 2017-11-29 07:15:36 -06:00
Gregory Nutt
f3b37e5da3 fs/procfs/fs_procfsprogrem: Add /proc/progmem. This is an alternative way to get the information that was previoulsy available in apps/system/free. apps/system/free was removed beause it made illegal calls into the OS violating the portable interface. This new procfs entry provides the same information with no such violation. 2017-11-13 09:08:39 -06:00
Gregory Nutt
e52bc92238 drivers/mtd/filemtd.c: Don't use file descriptors... Use the internal file system interfaces so that the loop device can be shared across threads. 2017-11-02 17:07:08 -06:00
Gregory Nutt
bc40403516 There was a reference counting problem in the TPC logic of net_clone(). net_clone() which is the common logic underlying dup() and dup2() for sockets. When net_clone() calls net_start_monitor() and net_start_monitor() returns a failure (because the underlying TCP connection) then net_clone() must back out the reference count on the structure. Problem noted by Pascal Speck and this implementation of the solution is based on his suggestion. 2017-10-19 11:09:23 -06:00
Jussi Kivilinna
5ef548677a drivrs/mtd/filemtd.c: add block device MTD interface. Block MTD interface allows using block device directly as MTD instead of having to use file-system in between. NOTE that this provides the opposite capability of FTL which will let you use an MTD interface directly as a block device. 2017-10-19 09:53:41 -06:00
Gregory Nutt
181875f3ba fs/vfs: Add new internal OS interface nx_read(). nx_read() is functionally equivalent to read() except that it does not modify the errno variable and it is not a cancellation point. Changed all references to read() in the OS to nx_read(). 2017-10-11 12:13:41 -06:00
Gregory Nutt
a00d8e16a1 Adds OS internal function nx_write() which is functionally equivalent to write() except that it does not set the errno variable and do not cause cancellation points. 2017-10-11 10:18:30 -06:00
Gregory Nutt
936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Sebastien Lorquet
9ea215f2e4 Merged in slorquet/nuttx/mt25q (pull request #501)
Add support for Micron MT25Q series MT25Q128

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-02 18:33:54 +00:00
Simon Piriou
b1f50490bd MTD: Add driver for Macronix QuadSPI flash memory 2017-08-06 10:51:17 -06:00
Gregory Nutt
e8738e1f55 Minor update to some comments. 2017-08-04 09:00:58 -06:00
Gregory Nutt
bbc06dcd8e RAMTRON: Should be able to select chunked write mode via a configuration option, not by editing the file. 2017-08-04 08:49:07 -06:00
Boris Astardzhiev
79ee0a5209 RAMTRON: Add support for splitting block writes in chunks. Some Re-RAMs like MB85AS4MT has a write buffer size limitation. 2017-08-04 08:12:59 -06:00
Gregory Nutt
95e20afcd2 drivers/: Remove dangling space at the end of lines. 2017-06-28 13:17:17 -06:00
Jussi Kivilinna
4eaa136850 smart: fix wrong freeing of device structure and use-after-free issues on error paths 2017-06-28 07:20:07 -06:00
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