29 Aug, 2019

1 commit

  • lib/devres.c, which implements devm_ioremap_resource(), is only built
    when CONFIG_HAS_IOMEM is set/enabled, so MTD_HYPERBUS should depend
    on HAS_IOMEM. Fixes a build error and a Kconfig warning (as seen on
    UML builds):

    WARNING: unmet direct dependencies detected for MTD_COMPLEX_MAPPINGS
    Depends on [n]: MTD [=m] && HAS_IOMEM [=n]
    Selected by [m]:
    - MTD_HYPERBUS [=m] && MTD [=m]

    ERROR: "devm_ioremap_resource" [drivers/mtd/hyperbus/hyperbus-core.ko] undefined!

    Fixes: dcc7d3446a0f ("mtd: Add support for HyperBus memory devices")
    Signed-off-by: Randy Dunlap
    Cc: Vignesh Raghavendra
    Cc: Miquel Raynal
    Cc: Geert Uytterhoeven
    Cc: linux-mtd@lists.infradead.org
    Acked-by: Vignesh Raghavendra
    Signed-off-by: Miquel Raynal

    Randy Dunlap
     

23 Aug, 2019

1 commit

  • …kernel/git/gustavoars/linux

    Pull more fallthrough fixes from Gustavo A. R. Silva:
    "Fix fall-through warnings on arm and mips for multiple configurations"

    * tag 'Wimplicit-fallthrough-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
    video: fbdev: acornfb: Mark expected switch fall-through
    scsi: libsas: sas_discover: Mark expected switch fall-through
    MIPS: Octeon: Mark expected switch fall-through
    power: supply: ab8500_charger: Mark expected switch fall-through
    watchdog: wdt285: Mark expected switch fall-through
    mtd: sa1100: Mark expected switch fall-through
    drm/sun4i: tcon: Mark expected switch fall-through
    drm/sun4i: sun6i_mipi_dsi: Mark expected switch fall-through
    ARM: riscpc: Mark expected switch fall-through
    dmaengine: fsldma: Mark expected switch fall-through

    Linus Torvalds
     

21 Aug, 2019

1 commit

  • Mark switch cases where we are expecting to fall through.

    Fix the following warning (Building: assabet_defconfig arm):

    drivers/mtd/maps/sa1100-flash.c: In function ‘sa1100_probe_subdev’:
    drivers/mtd/maps/sa1100-flash.c:82:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
    printk(KERN_WARNING "SA1100 flash: unknown base address "
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "0x%08lx, assuming CS0\n", phys);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/maps/sa1100-flash.c:85:2: note: here
    case SA1100_CS0_PHYS:
    ^~~~

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

13 Aug, 2019

1 commit

  • spi_nor_spansion_clear_sr_bp() depends on spansion_quad_enable().
    While spansion_quad_enable() is selected as default when
    initializing the flash parameters, the nor->quad_enable() method
    can be overwritten later on when parsing BFPT.

    Select the write protection disable mechanism at spi_nor_init() time,
    when the nor->quad_enable() method is already known.

    Fixes: 191f5c2ed4b6faba ("mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes")
    Signed-off-by: Tudor Ambarus
    Reviewed-by: Vignesh Raghavendra
    Signed-off-by: Richard Weinberger

    Tudor Ambarus
     

05 Aug, 2019

1 commit

  • Pull MTD fixes from Miquel Raynal:
    "NAND:

    - Fix Micron driver as some chips enable internal ECC correction
    during their discovery while they advertize they do not have any.

    Hyperbus:

    - Restrict the build to only ARM64 SoCs (and compile testing) which
    is what should have been done since the beginning.

    - Fix Kconfig issue by selection something instead of implying it"

    * tag 'mtd/fixes-for-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
    mtd: hyperbus: Add hardware dependency to AM654 driver
    mtd: hyperbus: Kconfig: Fix HBMC_AM654 dependencies
    mtd: rawnand: micron: handle on-die "ECC-off" devices correctly

    Linus Torvalds
     

03 Aug, 2019

3 commits

  • The hbmc-am654 driver is for the TI AM654, which is an ARM64 SoC, so
    don't propose this driver on other architectures unless
    build-testing.

    Fixes: b07079f1642c ("mtd: hyperbus: Add driver for TI's HyperBus memory controller")
    Signed-off-by: Jean Delvare
    Cc: Vignesh Raghavendra
    Cc: Miquel Raynal
    Signed-off-by: Miquel Raynal

    Jean Delvare
     
  • On x86_64, when CONFIG_OF is not disabled:

    WARNING: unmet direct dependencies detected for MUX_MMIO
    Depends on [n]: MULTIPLEXER [=y] && (OF [=n] || COMPILE_TEST [=n])
    Selected by [y]:
    - HBMC_AM654 [=y] && MTD [=y] && MTD_HYPERBUS [=y]

    due to
    config HBMC_AM654
    tristate "HyperBus controller driver for AM65x SoC"
    select MULTIPLEXER
    select MUX_MMIO

    Fix this by making HBMC_AM654 imply MUX_MMIO instead of select so
    that dependencies are taken care of. MUX_MMIO is optional for
    functioning of driver.

    Fixes: b07079f1642c ("mtd: hyperbus: Add driver for TI's HyperBus memory controller")
    Reported-by: Randy Dunlap
    Signed-off-by: Vignesh Raghavendra
    Acked-by: Randy Dunlap # build-tested
    Signed-off-by: Miquel Raynal

    Vignesh Raghavendra
     
  • Some devices are not supposed to support on-die ECC but experience
    shows that internal ECC machinery can actually be enabled through the
    "SET FEATURE (EFh)" command, even if a read of the "READ ID Parameter
    Tables" returns that it is not.

    Currently, the driver checks the "READ ID Parameter" field directly
    after having enabled the feature. If the check fails it returns
    immediately but leaves the ECC on. When using buggy chips like
    MT29F2G08ABAGA and MT29F2G08ABBGA, all future read/program cycles will
    go through the on-die ECC, confusing the host controller which is
    supposed to be the one handling correction.

    To address this in a common way we need to turn off the on-die ECC
    directly after reading the "READ ID Parameter" and before checking the
    "ECC status".

    Cc: stable@vger.kernel.org
    Fixes: dbc44edbf833 ("mtd: rawnand: micron: Fix on-die ECC detection logic")
    Signed-off-by: Marco Felsch
    Reviewed-by: Boris Brezillon
    Signed-off-by: Miquel Raynal

    Marco Felsch
     

26 Jul, 2019

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    This patch fixes the following warning:

    drivers/mtd/nand/onenand/onenand_base.c: In function ‘onenand_check_features’:
    drivers/mtd/nand/onenand/onenand_base.c:3264:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
    this->options |= ONENAND_HAS_NOP_1;
    drivers/mtd/nand/onenand/onenand_base.c:3265:2: note: here
    case ONENAND_DEVICE_DENSITY_4Gb:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Cc: Jonathan Bakker
    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

15 Jul, 2019

2 commits

  • While I was tempted to move it to admin-guide, as some docs
    there are more userspace-faced, there are some very technical
    discussions about memory error correction code from the Kernel
    implementer's PoV. So, let's place it inside the driver-api
    book.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Rename the mtd documentation files to ReST, add an
    index for them and adjust in order to produce a nice html
    output via the Sphinx build system.

    It should be noticed that Sphinx doesn't handle very well
    URLs with dots in the middle. Thankfully, internally, the '.'
    char is translated to %2E, so we can jus use %2E instead of
    dots, and this will work fine on both text and processed files.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

14 Jul, 2019

1 commit

  • Pull MTD updates from Miquel Raynal:
    "This contains the following changes for MTD:

    MTD core changes:
    - New Hyperbus framework
    - New _is_locked (concat) implementation
    - Various cleanups

    NAND core changes:
    - use longest matching pattern in ->exec_op() default parser
    - export NAND operation tracer
    - add flag to indicate panic_write in MTD
    - use kzalloc() instead of kmalloc() and memset()

    Raw NAND controller drivers changes:
    - brcmnand:
    - fix BCH ECC layout for large page NAND parts
    - fallback to detected ecc-strength, ecc-step-size
    - when oops in progress use pio and interrupt polling
    - code refactor code to introduce helper functions
    - add support for v7.3 controller
    - FSMC:
    - use nand_op_trace for operation tracing
    - GPMI:
    - move all driver code into single file
    - various cleanups (including dmaengine changes)
    - use runtime PM to manage clocks
    - implement exec_op
    - MTK:
    - correct low level time calculation of r/w cycle
    - improve data sampling timing for read cycle
    - add validity check for CE# pin setting
    - fix wrongly assigned OOB buffer pointer issue
    - re-license MTK NAND driver as Dual MIT/GPL
    - STM32:
    - manage the get_irq error case
    - increase DMA completion timeouts

    Raw NAND chips drivers changes:
    - Macronix: add read-retry support

    Onenand driver changes:
    - add support for 8Gb datasize chips
    - avoid fall-through warnings

    SPI-NAND changes:
    - define macros for page-read ops with three-byte addresses
    - add support for two-byte device IDs and then for GigaDevice
    GD5F1GQ4UFxxG
    - add initial support for Paragon PN26G0xA
    - handle the case where the last page read has bitflips

    SPI-NOR core changes:
    - add support for the mt25ql02g and w25q16jv flashes
    - print error in case of jedec read id fails
    - is25lp256: add post BFPT fix to correct the addr_width

    SPI NOR controller drivers changes:
    - intel-spi: Add support for Intel Elkhart Lake SPI serial flash
    - smt32: remove the driver as the driver was replaced by spi-stm32-qspi.c
    - cadence-quadspi: add reset control"

    * tag 'mtd/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (60 commits)
    mtd: concat: implement _is_locked mtd operation
    mtd: concat: refactor concat_lock/concat_unlock
    mtd: abi: do not use C++ style comments in uapi header
    mtd: afs: remove unneeded NULL check
    mtd: rawnand: stm32_fmc2: increase DMA completion timeouts
    mtd: rawnand: Use kzalloc() instead of kmalloc() and memset()
    mtd: hyperbus: Add driver for TI's HyperBus memory controller
    mtd: spinand: read returns badly if the last page has bitflips
    mtd: spinand: Add initial support for Paragon PN26G0xA
    mtd: rawnand: mtk: Re-license MTK NAND driver as Dual MIT/GPL
    mtd: rawnand: gpmi: remove double assignment to block_size
    dt-bindings: mtd: brcmnand: Add brcmnand, brcmnand-v7.3 support
    mtd: rawnand: brcmnand: Add support for v7.3 controller
    mtd: rawnand: brcmnand: Refactored code to introduce helper functions
    mtd: rawnand: brcmnand: When oops in progress use pio and interrupt polling
    mtd: Add flag to indicate panic_write
    mtd: rawnand: Add Macronix NAND read retry support
    mtd: onenand: Avoid fall-through warnings
    mtd: spinand: Add support for GigaDevice GD5F1GQ4UFxxG
    mtd: spinand: Add support for two-byte device IDs
    ...

    Linus Torvalds
     

10 Jul, 2019

1 commit

  • Pull Documentation updates from Jonathan Corbet:
    "It's been a relatively busy cycle for docs:

    - A fair pile of RST conversions, many from Mauro. These create more
    than the usual number of simple but annoying merge conflicts with
    other trees, unfortunately. He has a lot more of these waiting on
    the wings that, I think, will go to you directly later on.

    - A new document on how to use merges and rebases in kernel repos,
    and one on Spectre vulnerabilities.

    - Various improvements to the build system, including automatic
    markup of function() references because some people, for reasons I
    will never understand, were of the opinion that
    :c:func:``function()`` is unattractive and not fun to type.

    - We now recommend using sphinx 1.7, but still support back to 1.4.

    - Lots of smaller improvements, warning fixes, typo fixes, etc"

    * tag 'docs-5.3' of git://git.lwn.net/linux: (129 commits)
    docs: automarkup.py: ignore exceptions when seeking for xrefs
    docs: Move binderfs to admin-guide
    Disable Sphinx SmartyPants in HTML output
    doc: RCU callback locks need only _bh, not necessarily _irq
    docs: format kernel-parameters -- as code
    Doc : doc-guide : Fix a typo
    platform: x86: get rid of a non-existent document
    Add the RCU docs to the core-api manual
    Documentation: RCU: Add TOC tree hooks
    Documentation: RCU: Rename txt files to rst
    Documentation: RCU: Convert RCU UP systems to reST
    Documentation: RCU: Convert RCU linked list to reST
    Documentation: RCU: Convert RCU basic concepts to reST
    docs: filesystems: Remove uneeded .rst extension on toctables
    scripts/sphinx-pre-install: fix out-of-tree build
    docs: zh_CN: submitting-drivers.rst: Remove a duplicated Documentation/
    Documentation: PGP: update for newer HW devices
    Documentation: Add section about CPU vulnerabilities for Spectre
    Documentation: platform: Delete x86-laptop-drivers.txt
    docs: Note that :c:func: should no longer be used
    ...

    Linus Torvalds
     

08 Jul, 2019

4 commits


07 Jul, 2019

1 commit

  • NAND core changes:
    - use longest matching pattern in ->exec_op() default parser
    - export NAND operation tracer
    - add flag to indicate panic_write in MTD
    - use kzalloc() instead of kmalloc() and memset()

    Raw NAND controller drivers changes:
    - brcmnand:
    * fix BCH ECC layout for large page NAND parts
    * fallback to detected ecc-strength, ecc-step-size
    * when oops in progress use pio and interrupt polling
    * code refactor code to introduce helper functions
    * add support for v7.3 controller
    - FSMC:
    * use nand_op_trace for operation tracing
    - GPMI:
    * move all driver code into single file
    * various cleanups (including dmaengine changes)
    * use runtime PM to manage clocks
    * implement exec_op
    - MTK:
    * correct low level time calculation of r/w cycle
    * improve data sampling timing for read cycle
    * add validity check for CE# pin setting
    * fix wrongly assigned OOB buffer pointer issue
    * re-license MTK NAND driver as Dual MIT/GPL
    - STM32:
    * manage the get_irq error case
    * increase DMA completion timeouts

    Raw NAND chips drivers changes:
    - Macronix: add read-retry support

    Onenand driver changes:
    - add support for 8Gb datasize chips
    - avoid fall-through warnings

    SPI-NAND changes:
    - define macros for page-read ops with three-byte addresses
    - add support for two-byte device IDs and then for GigaDevice
    GD5F1GQ4UFxxG
    - add initial support for Paragon PN26G0xA
    - handle the case where the last page read has bitflips

    Richard Weinberger
     

06 Jul, 2019

2 commits

  • Allwinner NAND controllers can make use of DMA to enhance the I/O
    throughput thanks to ECC pipelining. DMA handling with A23/A33 NAND IP
    is a bit different than with the older SoCs, hence the introduction of
    a new compatible to handle:
    * the differences between register offsets,
    * the burst length change from 4 to minimum 8,
    * manage SRAM accesses through MBUS with extra configuration.

    Fixes: c49836f05aa1 ("mtd: rawnand: sunxi: Add A23/A33 DMA support")
    Signed-off-by: Miquel Raynal

    Miquel Raynal
     
  • This reverts commit c49836f05aa15282f7280e06ede3f6f8a6324833.

    The commit is wrong and its approach actually does not work. Let's
    revert it in order to add the feature with a clean patch.

    Fixes: c49836f05aa1 ("mtd: rawnand: sunxi: Add A23/A33 DMA support")
    Signed-off-by: Miquel Raynal

    Miquel Raynal
     

01 Jul, 2019

2 commits

  • If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
    which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:

    drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
    ingenic_nand.c:(.text+0x177): undefined reference to `ingenic_ecc_release'
    drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
    ingenic_nand.c:(.text+0x2ee): undefined reference to `ingenic_ecc_correct'

    To fix that, the ingenic_nand and ingenic_ecc modules have been fused
    into one single module.
    - The ingenic_ecc.c code is now compiled in only if
    $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean instead
    of tristate.
    - To avoid changing the module name, the ingenic_nand.c file is moved to
    ingenic_nand_drv.c. Then the module name is still ingenic_nand.
    - Since ingenic_ecc.c is no more a module, the module-specific macros
    have been dropped, and the functions are no more exported for use by
    the ingenic_nand driver.

    Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
    Signed-off-by: Paul Cercueil
    Reported-by: Arnd Bergmann
    Reported-by: Hulk Robot
    Cc: YueHaibing
    Cc: stable@vger.kernel.org
    Signed-off-by: Miquel Raynal

    Paul Cercueil
     
  • The 1Gb Macronix chip can have a maximum of 20 bad blocks, while
    the 2Gb version has twice as many blocks and therefore the maximum
    number of bad blocks is 40.

    The 4Gb GigaDevice GD5F4GQ4xA has twice as many blocks as its 2Gb
    counterpart and therefore a maximum of 80 bad blocks.

    Fixes: 377e517b5fa5 ("mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg")
    Reported-by: Emil Lenngren
    Signed-off-by: Frieder Schrempf
    Signed-off-by: Miquel Raynal

    Frieder Schrempf
     

28 Jun, 2019

18 commits

  • When the system is overloaded, DMA data transfer completion occurs after
    100ms. Increase the timeouts to let it the time to complete.

    Signed-off-by: Amelie Delaunay
    Signed-off-by: Christophe Kerello
    Signed-off-by: Miquel Raynal

    Amelie Delaunay
     
  • Replace kmalloc() by a memset() followed with a kzalloc().

    There is a recommendation to use zeroing allocator
    rather than allocator followed by memset(0) in
    ./scripts/coccinelle/api/alloc/zalloc-simple.cocci

    Signed-off-by: Fuqian Huang
    Signed-off-by: Miquel Raynal

    Fuqian Huang
     
  • Add driver for HyperBus memory controller on TI's AM654 SoC. Programming
    IP is pretty simple and provides direct memory mapped access to
    connected Flash devices.

    Add basic support for the IP without DMA. Second chip-select is not
    supported for now.

    Signed-off-by: Vignesh Raghavendra
    Signed-off-by: Miquel Raynal

    Vignesh Raghavendra
     
  • In case of the last page containing bitflips (ret > 0),
    spinand_mtd_read() will return that number of bitflips for the last
    page while it should instead return max_bitflips like it does when the
    last page read returns with 0.

    Signed-off-by: Weixiong Liao
    Reviewed-by: Boris Brezillon
    Reviewed-by: Frieder Schrempf
    Cc: stable@vger.kernel.org
    Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
    Signed-off-by: Miquel Raynal

    liaoweixiong
     
  • Add initial support for Paragon Technology
    PN26G01Axxxxx and PN26G02Axxxxx SPI NAND

    Datasheets available at
    http://www.xtxtech.com/upfile/2016082517274590.pdf
    http://www.xtxtech.com/upfile/2016082517282329.pdf

    Signed-off-by: Jeff Kletsky
    Reviewed-by: Frieder Schrempf
    Signed-off-by: Miquel Raynal

    Jeff Kletsky
     
  • It is wanted to use MTK NAND driver with GPL-2.0 or MIT license.
    But now it is only licensed as GPL-2.0, so re-license it as dual
    MIT/GPL.

    Signed-off-by: Xiaolei Li
    Acked-by: Jorge Ramirez-Ortiz
    Acked-by: Ryder Lee
    Acked-by: Rafał Miłecki
    Acked-by: Miquel Raynal
    Acked-by: Boris Brezillon
    Acked-by: Wen Yang
    Acked-by: Dan Carpenter
    Acked-by: Arnd Bergmann
    Acked-by: Masahiro Yamada
    Acked-by: RogerCC Lin
    Reviewed-by: Matthias Brugger
    Signed-off-by: Miquel Raynal

    Xiaolei Li
     
  • The variable block_size is being assigned to itself and to
    geo->ecc_chunk_size. Clean up the double assignment by removing
    the assignment to itself.

    Addresses-Coverity: ("Evaluation order violation")
    Signed-off-by: Colin Ian King
    Signed-off-by: Miquel Raynal

    Colin Ian King
     
  • This change adds support for brcm NAND v7.3 controller. This controller
    uses a newer version of flash_dma engine and change mostly implements
    these differences.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Miquel Raynal

    Kamal Dasu
     
  • Refactored NAND ECC and CMD address configuration code to use helper
    functions.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Miquel Raynal

    Kamal Dasu
     
  • If mtd_oops is in progress, switch to polling during NAND command
    completion instead of relying on DMA/interrupts so that the mtd_oops
    buffer can be completely written in the assigned NAND partition.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Miquel Raynal

    Kamal Dasu
     
  • Added a flag to indicate a panic_write so that low level drivers can
    use it to take required action where applicable, to ensure oops data
    gets written to assigned mtd device.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Miquel Raynal

    Kamal Dasu
     
  • Add support for Macronix NAND read retry.

    Macronix NANDs support specific read operation for data recovery,
    which can be enabled with a SET_FEATURE.
    Driver checks byte 167 of Vendor Blocks in ONFI parameter page table
    to see if this high-reliability function is supported.

    Signed-off-by: Mason Yang
    Signed-off-by: Miquel Raynal

    Mason Yang
     
  • NOTICE THAT:

    "...we don't know whether we need fallthroughs or breaks here and this
    is just a change to avoid having new warnings when switching to
    -Wimplicit-fallthrough but this change might be entirely wrong."[1]

    See the original thread of discussion here:

    https://lore.kernel.org/patchwork/patch/1036251/

    So, in preparation to enabling -Wimplicit-fallthrough, this patch silences
    the following warnings:

    drivers/mtd/nand/onenand/onenand_base.c: In function ‘onenand_check_features’:
    drivers/mtd/nand/onenand/onenand_base.c:3264:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (ONENAND_IS_DDP(this))
    ^
    drivers/mtd/nand/onenand/onenand_base.c:3284:2: note: here
    case ONENAND_DEVICE_DENSITY_2Gb:
    ^~~~
    drivers/mtd/nand/onenand/onenand_base.c:3288:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
    this->options |= ONENAND_HAS_UNLOCK_ALL;
    drivers/mtd/nand/onenand/onenand_base.c:3290:2: note: here
    case ONENAND_DEVICE_DENSITY_1Gb:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    Also, notice that this patch doesn't change any functionality. See the
    most recent thread of discussion here:

    https://lore.kernel.org/patchwork/patch/1077395/

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    [1] https://lore.kernel.org/lkml/20190509085318.34a9d4be@xps13/

    Cc: Miquel Raynal
    Suggested-by: Boris Brezillon
    Suggested-by: Kees Cook
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: Miquel Raynal

    Gustavo A. R. Silva
     
  • The GigaDevice GD5F1GQ4UFxxG SPI NAND is in current production devices
    and, while it has the same logical layout as the E-series devices,
    it differs in the SPI interfacing in significant ways.

    This support is contingent on previous commits to:

    * Add support for two-byte device IDs
    * Define macros for page-read ops with three-byte addresses

    http://www.gigadevice.com/datasheet/gd5f1gq4xfxxg/

    Signed-off-by: Jeff Kletsky
    Reviewed-by: Frieder Schrempf
    Signed-off-by: Miquel Raynal

    Jeff Kletsky
     
  • The GigaDevice GD5F1GQ4UFxxG SPI NAND utilizes two-byte device IDs.

    http://www.gigadevice.com/datasheet/gd5f1gq4xfxxg/

    Signed-off-by: Jeff Kletsky
    Reviewed-by: Frieder Schrempf
    Signed-off-by: Miquel Raynal

    Jeff Kletsky
     
  • This change supports nand-ecc-step-size and nand-ecc-strength fields in
    brcmnand DT node to be optional.
    see: Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt

    If both nand-ecc-strength and nand-ecc-step-size are not specified in
    device tree node for NAND, raw NAND layer does detect ECC information by
    reading ONFI extended parameter page for parts using ONFI >= 2.1.
    In case of non-ONFI NAND parts there could be a nand_id table entry with
    ECC information. If there is valid device tree entry for nand-ecc-strength
    and nand-ecc-step-size fields it still shall override the detected values.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Miquel Raynal

    Kamal Dasu
     
  • The gpmi driver performance suffers from NAND operations being split
    in multiple small DMA transfers. This has been forced by the NAND layer
    in the former days, but now with exec_op we can use the controller as
    intended.

    With this patch gpmi_nfc_exec_op becomes the main entry point to NAND
    operations. Here all instructions are collected and chained as separate
    DMA transfers. In the end whole chain is fired and waited to be
    finished. gpmi_nfc_exec_op only does the hardware operations, bad block
    marker swapping and buffer scrambling is done by the callers. It's worth
    noting that the nand_*_op functions always take the buffer lengths for
    the data that the NAND chip actually transfers. When doing BCH we have
    to calculate the net data size from the raw data size in some places.

    This patch has been tested with 2048/64 and 2048/128 byte NAND on
    i.MX6q. mtd_oobtest, mtd_subpagetest and mtd_speedtest run without
    errors. nandbiterrs, nandpagetest and nandsubpagetest userspace tests
    from mtdutils run without errors and UBIFS can successfully be mounted.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Miquel Raynal

    Sascha Hauer
     
  • The mxs dma driver uses the flags parameter in dmaengine_prep_slave_sg() for
    custom flags, but still uses the dmaengine specific names of the flags.
    Do a little bit better and at least give the flag a custom name.

    Signed-off-by: Sascha Hauer
    Acked-by: Vinod Koul
    Signed-off-by: Miquel Raynal

    Sascha Hauer