Commit Graph

400 Commits

Author SHA1 Message Date
Gregory Nutt 547a3cb3d9 Run all .c and .h files in previous commits through nxstyle. 2020-03-22 08:24:07 -05:00
Gregory Nutt 66ab039b89 drivers/: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
Nathan Hartman a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
Gregory Nutt c8b39b48bb z20x: w25boot configuration nees CONFIG_FS_WRITABLE
boards/z80/ez80/z20x/configs/w25boot/defconfig:  needs CONFIG_FS_WRITABLE=y

Style cleanup / Correct file header

  drivers/bch/bchdev_register.c, drivers/mtd/ftl.c, and fs/driver/fs_findblockdriver.c:
  Run through nxstyle; replace BSD-3 license with Apache 2.0
2020-03-07 16:59:38 -03:00
Gregory Nutt 3a7bf78c56 drivers/mtd/w25.c: Add support for work-alike AMIC parts
Verified with 8Mbit AMIC A25L080 part.
2020-03-07 12:12:50 -06:00
Gregory Nutt ee9949a724 z20x: Fix some SPI/W25/Timer issues.
arch/z80/src/ez80/ez80_spi.c:  Do not configure SPI chip select pin.  It is not used by the driver and configuring it just clobbers other usage of that pin.  Add some additional debug outputs; correct some exiting debug outputs.

drivers/mtd/w25.c:  Add some debug output.

boards/z80/ez80/z20x/src/ez80_w25.c:  Correct SPI bus number used in initialization.  Only SPI1 is supported.

arch/z80/src/ez80/ez80_timerisr.c:  Some initial timer configuration fixes.
2020-03-06 21:09:14 +01:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Gregory Nutt 21aef0dd68 drivers/*/Kconfig: Consolidate driver Kconfig Files.
This commit does two things:

1. First, it reorganizes the driver Kconfig files so that each is self contained.  Before, a part of the driver configuration was in drivers/Kconfig and the rest was in in drivers/xyz/Konfig.  Now, all of the driver configuration is consolitated in the latter.

2. Second, this commit correct numerous serious errors introduced in a previous reorganization of the driver Kconfig files.  This was first noted by Nicholas Chin in PR270 for the case of the drivers/i2c/Kconfig but some examination indicates that the error was introduced into several other Kconfig files as well.

The nature of the introduced error was basically this:

- Nothing must intervene between the menuconfig selection and the following conditional configuration otpions.
- A previous PR erroneously introduced unconditional options between the menuconfig and the following confditional logic, thus corrupting the driver menus.

This error was easy to make because the driver Kconfig files were not well modularized.  Making them fully self-contained should eliminate this kind of error in the future.
2020-02-15 15:19:11 +01:00
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