Commit Graph

336 Commits

Author SHA1 Message Date
Gregory Nutt
9546481054 Fix some typographical errors. 2018-09-14 06:55:45 -06:00
EunBong Song
d33b0640fe Merged in ebsong/nuttx (pull request #712)
Pull request for cortex-r4 codes

* arm/armv7-r: Add general interrupt controller.

    This is based on armv7-a gic controller code.

    Signed-off-by: EunBong Song <eunb.song@samsung.com>

* arm/armv7-r: add invalidate dcache in arm_head.S

    Adding invalidate dcache as a comment in arm_head.S.

    Signed-off-by: EunBong Song <eunb.song@samsung.com>

* arm/armv7-r: Fix some wrong configuration of program status register.

    PSR_E_BIT bit should be set for big endian system.
    PSR_A_BIT bis is set automatically as arm cortex-r4 reference manual 3.7.4.
    So we don't need to set this bit.

    Signed-off-by: EunBong Song <eunb.song@samsung.com>

* arm/armv7-r: Fix some wrong MPU register definition.

    Change MPU_RBAR_ADDR_MASK and MPU_RACR_TEX_SHIFT mask as
    arm cortex-r4 reference manual.

    Region Base Address Register 0-4 bits are reserved.
    MPU Region Access control register type 3-5 bits.

    Signed-off-by: EunBong Song <eunb.song@samsung.com>

* driver/mtd: fix compilation error.

    This commit fixes below compilation errors.

    CC:  mtd/smart.c
    mtd/smart.c:182:22: error: 'gWearBitToLevelMap4' defined but not used [-Werror=unused-const-variable=]
     static const uint8_t gWearBitToLevelMap4[] =
                          ^~~~~~~~~~~~~~~~~~~
    mtd/smart.c:170:22: error: 'gWearLevelToBitMap4' defined but not used [-Werror=unused-const-variable=]
     static const uint8_t gWearLevelToBitMap4[] =
                          ^~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [smart.o] Error 1

    Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>

Approved-by: GregoryN <gnutt@nuttx.org>
2018-08-29 01:50:41 +00:00
Gregory Nutt
15a1e44586 drivers/mtd/ftl.c: Reduce size of stack buffer from 64 to a maximum size as determined from NAME_MAX 2018-08-28 08:19:15 -06:00
Xiang Xiao
8b5ac497ad drivers/mtd/ftl.c: Support initialization of an FTL block device with a custom name 2018-08-28 07:15:57 -06:00
Xiang Xiao
41a1e76735 drivers/mtd/mtd_partition.c: Copy the partition name to internal buffer so that the caller can free the name argument 2018-08-28 07:09:59 -06:00
wangyanjiong
25f2bcea38 drivers/mtd: Add gd25 driver 2018-08-28 06:31:54 -06:00
Alan Carvalho de Assis
283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt
a0e169ad7b net/: Fix a sixlowpan typo bug recently introduced; Rename g_ipv6_allzeroaddre with the more meaning g_ipv6_unspecaddr since the all-zero address is the IPv6 unspecified address (sometime IN6_ADDR_ANY). Remove more inline tests for IPv6 multicast with tcommint net_is_addr_mcast() macro. Update some comments. 2018-06-23 12:53:27 -06:00
Gregory Nutt
01b740c66b arch/arm/src/efm32: Support for common vector handling is forced for all EFM32 chips. Yes the architecture provides support for the old-style dedicated vector handling which can never be compiled. Furthermore, the old-style dedicated vector handling is deprecated in favor of common vector handling. The commit resolves this inconsistency be removing support for the dedicated vector handling from the EFM32 architecture support. 2018-06-19 13:37:00 -06:00
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