Commit Graph

391 Commits

Author SHA1 Message Date
Xiang Xiao 3cb259daa6 drivers/Kconfig: Move if/endif to subfolder Kconfig
Move if/endif to subfolder Kconfig and make ARCH_HAVE_XXX option always selectable by moving out of if/endif
2020-02-08 08:04:05 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao 80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao 68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Alin Jerpelea ecfdd6e056 smartfs improvements #66
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle on all .c and .h and fix all issues

Author: Alin Jerpelea <alin.jerpelea@sony.com>

    drivers: mtd: smart: Add smartfs fsck feature

    Support fsck to check and repair the smartfs file system. If the power
    loss occurs during writing into the flash, the dead space are created
    in flash after the next power cycle. To avoid this problem, introduce
    fsck and keep the consistency of file system in initializing smartfs.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

commit 60927c5fb6a353994341601f55071c618e97682b
Author: Alin Jerpelea <alin.jerpelea@sony.com>
Date:   Thu Dec 28 18:27:21 2017 +0900

    drivers: mtd: smart: Fix duplicate sector selection in SmartFS

    Add care for 16-bit sequence without CRC.

    drivers: mtd: smart: Check CRC of duplicate sectors

    In the illegal case by power-loss, when the multiple logical sectors are
    duplicated, we compare the sequence number of each sector and select the newer
    sector. Just in case, add CRC check for the newer sector. If the newer sector
    has CRC error, then we use the older sector.

    drivers: mtd: smart: SPI-Flash recovery from the initial error state

    The FLASH may be not erased in the initial delivery state.
    Just in case for the recovery of this fatal situation,
    after once erasing the sector, return the sector as a free sector.

    drivers: mtd: smart: Fix error handling in smartfs mtd driver

    Add error handling in relocate sector.

    drivers: mtd: smart: Fix initialize sector sequence value in smartfs

    Fix initialization of sequence value into sector header and also avoid
    unaligned memory access when CONFIG_MTD_SMART_ENABLE_CRC=n.

    drivers: mtd: smart: Fix handling of duplicate sector in smartfs

    In smartfs scan, if duplicate logical sector is found on the device,
    then smartfs selects the winner sector by comparing sequence number,
    and the loser sector is soon released. Fix a bug this loser sector
    is registered into logical-to-physical sector mapping table.
2020-01-09 10:14:39 -03:00
Gregory Nutt 9d5d60fee1 Run all .c and .h files in last PR49 through nxstyle. 2020-01-07 09:54:35 -06:00
Alin Jerpelea a8d63c0cec various fixes (#49)
* libs: libc: math: Fix tanh() math functions
* drivers: mtd: smart: Fix trivial debug message in smartfs
* binfmt: libelf: Fix fd not closed on error
* binfmt: Fix stack memory leak on error
* fs: romfs: Fix private data not free on error
* sched: group: Fix reference after free memory
* sched: clock: Fix clock sync

Fix clock sync when CONFIG_RTC_HIRES is enabled
2020-01-07 09:06:02 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt 9e4602a2f4 drivers/mtd: Apply tools/nxstyle to a few files. Lots more to check. 2019-12-07 08:25:16 -06:00
Gregory Nutt 244437257b drivers/: Within the OS, nxisg_usleep() should be used instead of usleep(). usleep() is a cancellation point and sets the errno value. Neither of which should be done inside the OS. 2019-11-29 17:37:39 -06:00
Ouss4 a284896ce1 drivers/mtd/sst26.c: Default memory type is 0x26. 2019-11-23 08:49:51 -06:00
kyChu 03a47a5fbd Merged in kyChuGit/nuttx/driver_update (pull request #1073)
Driver update

* drivers/mtd/Make.defs:  Add MTD driver for QuadSPI-based Winbond NOR FLASH

* stm32l4/stm32l4_qspi.c:  the "QSPI_DMA_PRIO" has been defined above

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-11-21 12:10:49 +00:00
kyChu 261a6ff758 Author: Gregory Nutt <gnutt@nuttx.org>
Misc changes made following recommendatinos of tools/nxstyle.

Author: kyChu <hello.kychu@gmail.com>

    drivers/mtd/w25qxxxjv.c:  Add QSPI-based Winbond NOR FLASH driver
    drivers/mtd/Kconfig:  include w25qxxxjv mtd driver to menuconfig
    mtd/mtd.h:  add function prototype of w25qxxxjv_initialize
2019-11-20 17:25:40 -06:00
ligd efaba3be7d drivers/mtd/gd25.c: Add gd25_lock/unlock to case: enable 4-bytes address. 2019-11-12 09:02:19 -06:00
ligd bf98b28737 drivers/mtd/gd25.c: Add gd25_lock/unlock to case: enable 4-bytes address 2019-11-12 09:01:10 -06:00
Matouš Pokorný 4d59d6cbcc drivers/mtd/mtd_progmem.c: Small typo fix. 2019-11-07 07:46:22 -06:00
Juha Niskanen dc3edca5a7 drivers/mtd/gd25.c: spi_devid argument was not used in initialization. Commit 4fc41b55b to GD25 driver was always using priv->spi_devid initialized to zero by kmm_zalloc(). This commit initializes it from the supplied function argument. 2019-10-31 07:43:21 -06:00
Xiang Xiao 4fc41b55b3 drivers/mtd/gd25.c and gd5f.c: Change missed in previous patch set. Without this change, the compiler will complain that spi_devid cannot be found. 2019-10-29 07:48:17 -06:00
YanLin Zhu 6d63ba711b drivers/mtd/gd25.c: Add 4byte address operation for capacity larger than 128Mbit. 2019-10-25 07:31:41 -06:00
YanLin Zhu bcdf9074fe drivers/mtd/gd5f.c: Add gigadevice SPI NAND FLASH driver. 2019-09-15 08:33:22 -06:00
YanLin Zhu 8b10b8ad25 drivers/mtd/gd25.c: Add support for GD25 device with 256-Mbit capacity. 2019-09-15 08:19:06 -06:00
zhangbo_a 636d180219 drivers/mtd/gd25.c: Add support for a new FLASH vendor. 2019-09-15 08:17:19 -06:00
Gregory Nutt 7ad9dfb610 drivers/mtd/mx25lx.c: Minor changes to conform to coding standard detected by tools/nxstyle. 2019-08-21 16:16:39 -06:00
jjlange 7b6cff6f84 Merged in jjlange/nuttx/mx25l_4B (pull request #1016)
Add support for 4-byte addressing on >128Mb Macronix flash parts

* Save CONFIG_ARCH_BOARD_CUSTOM when running 'make savedefconfig'

* Only use PCLKSEL0 for ADC on LPC176x family.

* Made grep search expression more specific.

* Added missing '=' to second grep

* Revert "Only use PCLKSEL0 for ADC on LPC176x family."

    This reverts commit 835b5e9d6f.

* Revert "Added missing '=' to second grep"

    This reverts commit 38b51f0c6d.

* Added a missing '=' in the second grep statement

* Added support for 4-byte addressing on >128Mb Macronix flash parts

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-21 22:09:45 +00:00
Gregory Nutt e0f1469526 Fix warnings found in build testing. 2019-07-28 17:50:57 -06:00
Simon Piriou 780d4d41e8 drivers/mtd/mx25rxx.c: add support for 512B sectors
- Fix for mx25rxx driver as it does not work properly
- Add mx25rxx memory chip & smartfs support in b-l475e-iot01a/nsh config
- Update smartfs smart_scan() function
2019-07-26 09:19:26 -06:00
Ouss4 99111c2af8 drivers/mtd/sst26.c: Accept the 16MBit Flash when reading the JEDEC-ID at init. 2019-07-21 16:07:44 -06:00
Gregory Nutt b49be4bb20 Squashed commit of the following:
arch/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    sched/ audio/ crypto/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    Documentation/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    fs/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    graphics/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    net/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    drivers/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    include/, syscall/, wireless/:  Removed all references to CONFIG_DISABLE_POLL.  The standard POSIX poll() can not longer be disabled.
    configs/:  Remove all references to CONFIG_DISABLE_POLL.  Standard POSIX poll can no longer be disabled.
2019-05-21 18:57:54 -06:00
Gregory Nutt dc8c814ca3 Squashed commit of the following:
Fixed coding standard error in several files.  Use of while( is incorrect; a space is required between while and (.  Also ran tools/nxstyle and fix thoses complaints as well in most files.

    Changes to comply with coding standard.  Mostly focused on files with missing space after keyword in if(, switch(, and for(.  Offending files also got changes to comply with tools nxstyle.  If there were logs of nxstyle complaints, the file also got a taste of tools/indent.sh.  Still need to fix occurrences of while( with missing space.  There are a lot of them.
2019-02-27 08:41:08 -06:00
Ken Pettit c883c8a535 drivers/mtd/smart.c: Fix for the SmartFS MTD layer size mapping issue. With this patch, existing SmartFS drives should still mount and work properly, plus the larger sector sizes are now supported correctly. 2019-01-10 07:13:19 -06:00
Ken Pettit 47c8e537d1 drivers/mtd/s25fl1.c: Minor change for the s25fl1 QSPI FLASH driver which fixes additional sectorshift vs. pageshift confusion. 2019-01-09 07:24:58 -06:00
Jussi Kivilinna 0b41938bb6 drivers/mtd/mtd_config.c: Check return value mtdconfig_readbytes() 2019-01-02 09:52:55 -06:00
Daniel P. Carvalho 30ddb909c0 drivers/mtd/smart.c: Fix smart_write_alloc_sector sector size calculation. 2018-12-29 17:03:00 -06:00
Gregory Nutt 0cd5a232ea Fix a few typos. 2018-12-27 08:45:26 -06:00
Gregory Nutt c137c6ef1f Clean up typos in some comments. 2018-12-22 08:12:34 -06:00
Ken Pettit baab6dd1bd Extends the MTD configdata device with the following features / additions:
1.  Configurable option to use named config items instead of enumerated ID/Instance numbers.
2.  Ability to iterate through the existing configdata items in the /dev/config device.
3.  Ability to "unset" a configdata item.
4.  Ability to perform "flash_eraseall" on the /dev/config device.
2018-12-20 14:14:40 -06:00
Gregory Nutt 5c9e72f99d Squashed commit of the following:
arch/arm/src/tiva/hardware/cc13x0/cc13x0_fcfg1.h:  Adjust cloned CC13x9 FCFG1 header file so that it reflects reality.

    arch/arm/src/tiva/hardware/cc13x0/cc13x0_fcfg1.h:  Add CC13x0 FCFG1 header file.  Initial commit is the same as the CC13x2/CC26x2 FCFG1 header with a few name changes.

    arch/arm/src/tiva/hardware/cc13x2_cc26x2/cc13x2_cc26x2_fcfg1.h:  Initial FCFG1 header file for the cc13xx/cc26xx family.
2018-12-13 12:35:39 -06:00
Marc Rosen 21328c528c drivers/mtd/at25.c: Fixed missing opening parenthesis. 2018-12-13 08:12:50 -06:00
Daniel P. Carvalho e34e9fd782 drivers/mtd/at45db.c: Correct some typos. 2018-12-12 18:21:27 -06:00
Marc Rosen 16dff59cbd drivers/mtd/at25.c: Added support for AT25DF081A serial flash chip 2018-12-12 07:04:27 -06:00
Xiang Xiao 2e18b603ad drivers/mtd/mtd_partition.c: Remove the hard code partition name length 2018-11-09 08:24:17 -06:00
Xiang Xiao 78b725907d drivers/mtd/ftl.c: ADd support support unlink operation to avoid the memory leak 2018-11-09 08:22:51 -06:00
Xiang Xiao 47a2edc7a4 drivers/mtd/ftl.c: Allocate eblock only when it's really needed 2018-11-09 08:21:10 -06:00
zhuyanlin e9000df50c drivers/mtd/ftl.c: Make READAHEAD and WRITEBUFFER work independently of each other. There have cases we use writebuffer but not readbuffer, so the write buffer must be flushed before read. Let rwb driver do it. 2018-11-09 08:18:46 -06:00
Xiang Xiao 65177b3344 drivers/mtd/ftl.c: Change ftl_initialize_by_name to ftl_initialize_by_path 2018-11-09 08:15:57 -06:00
Xiang Xiao 6ee09e8888 drivers/mtd/ftl.c: Support BIOC_FLUSH ioctl 2018-11-09 08:12:52 -06:00
Xiang Xiao 247414c6ad drivers/mtd and other MTD drivers: Remove mtd_procfsoperations since we can now get the same information from inode 2018-11-08 09:46:11 -06:00
Ken Pettit aa9771751b drivers/mtd/s25fl1.c: During a MTDIOC_GEOMETRY ioctl call, the driver was incorrectly reporting the blocksize to be the same as the erasesize. The blocksize should be 256 (the page size). This patch fixes that, and now the SmartFS configration is working. 2018-10-18 07:02:02 -06:00
David Sidrane 9547b186df Merged in david_s5/nuttx/Lampoo-master-spi-flash (pull request #735)
drivers/mtd: add support to Macronix MX25LF25635F serial NOR flash

Approved-by: GregoryN <gnutt@nuttx.org>
2018-10-17 23:24:45 +00:00
Dave Marples 91eb792e56 Corrections for the i.MXRT Ethernet:
(1) Now the Ethernet is completely re-initialized when an error occurs by means of taking the interface down and back up but the PHY is _not_ renegotiated for that case because that is very time consuming and an error in the Ethernet is no reflection on the state of the PHY anyway.

(2) Explicitly sets the expected PHY address to zero (this could be moved into the config) rather than searching for it which takes ages, and it's zero anyway for this board (that's the broadcast address, and anything that cannot respond on that has multiple PHYs, so that would be a new board).

(3) Allows for the renegotiation of the PHY to be optional when a reset is needed. If a non-renegotiated reset doesn't result in good comms to the PHY then it'll automatically be escalated to a renegotiated one.

(4) Only performs a reset for errors that need it (the CRITICAL_ERROR define).  The list of errors that need reset are somewhat arbitrarily chosen based on my prejudices and might need to be revisited, but certainly the jabber errors don't need reset, the partial packet is thrown away by the layer above anyway.

(5) Re-loads the multicast table on reset.

(6) Adds a bit more logging into the imxrt Ethernet module.
2018-09-28 07:25:48 -06:00