15 May, 2019

2 commits

  • Since commit dccd2304cc90 ("ARM: 7430/1: sizes.h: move from asm-generic
    to "), and are just
    wrappers of .

    This commit replaces all and to
    prepare for the removal.

    Link: http://lkml.kernel.org/r/1553267665-27228-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • This prepares to move CONFIG_OPTIMIZE_INLINING from x86 to a common
    place. We need to eliminate potential issues beforehand.

    Kbuild test robot has never reported -Wmaybe-uninitialized warning for
    this probably because vf610_nfc_run() is inlined by the x86 compiler's
    inlining heuristic.

    If CONFIG_OPTIMIZE_INLINING is enabled for a different architecture and
    vf610_nfc_run() is not inlined, the following warning is reported:

    drivers/mtd/nand/raw/vf610_nfc.c: In function `vf610_nfc_cmd':
    drivers/mtd/nand/raw/vf610_nfc.c:455:3: warning: `offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
    vf610_nfc_rd_from_sram(instr->ctx.data.buf.in + offset,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    nfc->regs + NFC_MAIN_AREA(0) + offset,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    trfr_sz, !nfc->data_access);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Link: http://lkml.kernel.org/r/20190423034959.13525-6-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Boris Brezillon
    Cc: Borislav Petkov
    Cc: Brian Norris
    Cc: Christophe Leroy
    Cc: David Woodhouse
    Cc: Heiko Carstens
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Marek Vasut
    Cc: Mark Rutland
    Cc: Mathieu Malaterre
    Cc: Miquel Raynal
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Stefan Agner
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

13 May, 2019

2 commits

  • Pull UBI/UBIFS updates from Richard Weinberger:

    - fscrypt framework usage updates

    - One huge fix for xattr unlink

    - Cleanup of fscrypt ifdefs

    - Fix for our new UBIFS auth feature

    * tag 'upstream-5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
    ubi: wl: Fix uninitialized variable
    ubifs: Drop unnecessary setting of zbr->znode
    ubifs: Remove ifdefs around CONFIG_UBIFS_ATIME_SUPPORT
    ubifs: Remove #ifdef around CONFIG_FS_ENCRYPTION
    ubifs: Limit number of xattrs per inode
    ubifs: orphan: Handle xattrs like files
    ubifs: journal: Handle xattrs like files
    ubifs: find.c: replace swap function with built-in one
    ubifs: Do not skip hash checking in data nodes
    ubifs: work around high stack usage with clang
    ubifs: remove unused function __ubifs_shash_final
    ubifs: remove unnecessary #ifdef around fscrypt_ioctl_get_policy()
    ubifs: remove unnecessary calls to set up directory key

    Linus Torvalds
     
  • Pull MTD updates from Richard Weinberger:
    "MTD core changes:
    - New AFS partition parser
    - Update MAINTAINERS entry
    - Use of fall-throughs markers

    NAND core changes:
    - Support having the bad block markers in either the first, second or
    last page of a block. The combination of all three location is now
    possible.
    - Constification of NAND_OP_PARSER(_PATTERN) elements.
    - Generic NAND DT bindings changed to yaml format (can be used to
    check the proposed bindings. First platform to be fully supported:
    sunxi.
    - Stopped using several legacy hooks.
    - Preparation to use the generic NAND layer with the addition of
    several helpers and the removal of the struct nand_chip from
    generic functions.
    - Kconfig cleanup to prepare the introduction of external ECC engines
    support.
    - Fallthrough comments.
    - Introduction of the SPI-mem dirmap API for SPI-NAND devices.

    Raw NAND controller drivers changes:
    - nandsim:
    - Switch to ->exec-op().
    - meson:
    - Misc cleanups and fixes.
    - New OOB layout.
    - Sunxi:
    - A23/A33 NAND DMA support.
    - Ingenic:
    - Full reorganization and cleanup.
    - Clear separation between NAND controller and ECC engine.
    - Support JZ4740 an JZ4725B.
    - Denali:
    - Clear controller/chip separation.
    - ->exec_op() migration.
    - Various cleanups.
    - fsl_elbc:
    - Enable software ECC support.
    - Atmel:
    - Sam9x60 support.
    - GPMI:
    - Introduce the GPMI_IS_MXS() macro.
    - Various trivial/spelling/coding style fixes.

    SPI NOR core changes:
    - Print all JEDEC ID bytes on error
    - Fix comment of spi_nor_find_best_erase_type()
    - Add region locking flags for s25fl512s

    SPI NOR controller drivers changes:
    - intel-spi:
    - Avoid crossing 4K address boundary on read/write
    - Add support for Intel Comet Lake SPI serial flash"

    * tag 'mtd/for-5.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (120 commits)
    mtd: part: fix incorrect format specifier for an unsigned long long
    mtd: lpddr_cmds: Mark expected switch fall-through
    mtd: phram: Mark expected switch fall-throughs
    mtd: cfi_cmdset_0002: Mark expected switch fall-throughs
    mtd: cfi_util: mark expected switch fall-throughs
    MAINTAINERS: MTD Git repository is hosted on kernel.org
    MAINTAINERS: Update jffs2 entry
    mtd: afs: add v2 partition parsing
    mtd: afs: factor the IIS read into partition parser
    mtd: afs: factor footer parsing into the v1 part parsing
    mtd: factor out v1 partition parsing
    mtd: afs: simplify partition detection
    mtd: afs: simplify partition parsing
    mtd: partitions: Add OF support to AFS partitions
    mtd: partitions: Add AFS partitions DT bindings
    mtd: afs: Move AFS partition parser to parsers subdir
    mtd: maps: Make uclinux_ram_map static
    mtd: maps: Allow MTD_PHYSMAP with MTD_RAM
    MAINTAINERS: Add myself as MTD maintainer
    MAINTAINERS: Remove my name from the MTD and NAND entries
    ...

    Linus Torvalds
     

08 May, 2019

1 commit

  • There is a potential execution path in which variable *err*
    is compared against UBI_IO_BITFLIPS without being properly
    initialized previously.

    Fix this by initializing variable *err* to 0.

    Addresses-Coverity-ID: 1477298 "(Uninitialized scalar variable")
    Fixes: 663586c0a892 ("ubi: Expose the bitrot interface")
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Richard Weinberger

    Gustavo A. R. Silva
     

07 May, 2019

22 commits

  • Pull mmiowb removal from Will Deacon:
    "Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb())

    Remove mmiowb() from the kernel memory barrier API and instead, for
    architectures that need it, hide the barrier inside spin_unlock() when
    MMIO has been performed inside the critical section.

    The only relatively recent changes have been addressing review
    comments on the documentation, which is in a much better shape thanks
    to the efforts of Ben and Ingo.

    I was initially planning to split this into two pull requests so that
    you could run the coccinelle script yourself, however it's been plain
    sailing in linux-next so I've just included the whole lot here to keep
    things simple"

    * tag 'arm64-mmiowb' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (23 commits)
    docs/memory-barriers.txt: Update I/O section to be clearer about CPU vs thread
    docs/memory-barriers.txt: Fix style, spacing and grammar in I/O section
    arch: Remove dummy mmiowb() definitions from arch code
    net/ethernet/silan/sc92031: Remove stale comment about mmiowb()
    i40iw: Redefine i40iw_mmiowb() to do nothing
    scsi/qla1280: Remove stale comment about mmiowb()
    drivers: Remove explicit invocations of mmiowb()
    drivers: Remove useless trailing comments from mmiowb() invocations
    Documentation: Kill all references to mmiowb()
    riscv/mmiowb: Hook up mmwiob() implementation to asm-generic code
    powerpc/mmiowb: Hook up mmwiob() implementation to asm-generic code
    ia64/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    mips/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    sh/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    m68k/io: Remove useless definition of mmiowb()
    nds32/io: Remove useless definition of mmiowb()
    x86/io: Remove useless definition of mmiowb()
    arm64/io: Remove useless definition of mmiowb()
    ARM/io: Remove useless definition of mmiowb()
    mmiowb: Hook up mmiowb helpers to spinlocks and generic I/O accessors
    ...

    Linus Torvalds
     
  • An unsigned long long is being formatted with %lld instead of the unsigned
    version %llu. Fix this.

    Clean up cppcheck warning:
    %lld in format string (no. 1) requires 'long long' but the argument type
    is 'unsigned long long'.

    Fixes: a62c24d75529 ("mtd: part: Add sysfs variable for offset of partition")
    Signed-off-by: Colin Ian King
    Signed-off-by: Richard Weinberger

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

    This patch fixes the following warnings:

    drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:
    drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (mode == FL_READY && chip->oldstate == FL_READY)
    ^
    drivers/mtd/lpddr/lpddr_cmds.c:322:2: note: here
    default:
    ^~~~~~~

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

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

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: Richard Weinberger

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

    This patch fixes the following warnings:

    drivers/mtd/devices/phram.c: In function ‘parse_num64’:
    drivers/mtd/devices/phram.c:149:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    shift += 10;
    ~~~~~~^~~~~
    drivers/mtd/devices/phram.c:150:4: note: here
    case 'M':
    ^~~~
    drivers/mtd/devices/phram.c:151:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
    shift += 10;
    ~~~~~~^~~~~
    drivers/mtd/devices/phram.c:152:4: note: here
    case 'k':
    ^~~~

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

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

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: Richard Weinberger

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

    This patch fixes the following warnings:

    drivers/mtd/chips/cfi_cmdset_0002.c: In function ‘get_chip’:
    drivers/mtd/chips/cfi_cmdset_0002.c:870:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (mode == FL_READY && chip->oldstate == FL_READY)
    ^
    drivers/mtd/chips/cfi_cmdset_0002.c:873:2: note: here
    default:
    ^~~~~~~
    drivers/mtd/chips/cfi_cmdset_0002.c: In function ‘cfi_amdstd_sync’:
    drivers/mtd/chips/cfi_cmdset_0002.c:2745:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
    chip->state = FL_SYNCING;
    ~~~~~~~~~~~~^~~~~~~~~~~~
    drivers/mtd/chips/cfi_cmdset_0002.c:2750:3: note: here
    case FL_SYNCING:
    ^~~~

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

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

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Tokunori Ikegami
    Signed-off-by: Richard Weinberger

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

    This patch fixes the following warnings:

    drivers/mtd/chips/cfi_util.c: In function ‘cfi_build_cmd’:
    drivers/mtd/chips/cfi_util.c:110:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    onecmd |= (onecmd << (chip_mode * 32));
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:112:2: note: here
    case 4:
    ^~~~
    drivers/mtd/chips/cfi_util.c:113:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
    onecmd |= (onecmd << (chip_mode * 16));
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:114:2: note: here
    case 2:
    ^~~~
    drivers/mtd/chips/cfi_util.c: In function ‘cfi_merge_status’:
    drivers/mtd/chips/cfi_util.c:163:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    res |= (onestat >> (chip_mode * 32));
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:165:2: note: here
    case 4:
    ^~~~
    drivers/mtd/chips/cfi_util.c:166:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
    res |= (onestat >> (chip_mode * 16));
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/mtd/chips/cfi_util.c:167:2: note: here
    case 2:
    ^~~~

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

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

    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Kees Cook
    Signed-off-by: Richard Weinberger

    Gustavo A. R. Silva
     
  • The AFS v2 partition type appear in later ARM reference designs
    such as RealView, Versatile Express and the 64bit Juno Development
    Platform.

    The image informations is padded with a 32bit word (4 bytes) on
    the 32bit platforms and a 64bit word (8 bytes) on the 64bit
    platforms. The boot monitor source code gives at hand that this
    is because the first entry in the struct mapped over the image
    information is a "next" pointer for a linked list, filled in
    by firmware after reading in the info block, and always zero
    in the flash. We adjust padding by checking what padding gives
    the right checksum.

    This was tested on:
    - Integrator/AP (v1 partitions)
    - RealView PB11MPCore (v2 32bit partitions)
    - Juno Development System (v2 64bit partitions)

    All systems display the images in flash very nicely as separate
    partitions, e.g on Juno:

    4 afs partitions found on MTD device 8000000.flash
    Creating 4 MTD partitions on "8000000.flash":
    0x000000040000-0x0000000c0000 : "fip"
    0x000000ec0000-0x0000018c0000 : "Image"
    0x000000f00000-0x000000f40000 : "juno"
    0x000003ec0000-0x000003f00000 : "bl1"

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • Factor the IIS (Image Information Structure) reading into the
    partition parser, giving us a single, clean partition parser
    function.

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • This simplifies the code by factoring in the image footer
    parsing into the single function parsing the AFSv1 partitions.

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • This breaks out the parsing of v1 partitions so we can later add
    a v2 partition parser.

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • Instead of reading out the AFS footers twice, create a separate
    function to just check if there is a footer or not. Rids a few
    local variables and prepare us to join the actual parser into
    one function.

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • This simplifies the AFS partition parsing to make the code
    more straight-forward and readable.

    Before this patch the code tried to calculate the memory required
    to hold the partition info by adding up the sizes of the strings
    of the names and adding that to a single memory allocation,
    indexing the name pointers in front of the struct mtd_partition
    allocations so all allocated data was in one chunk.

    This is overzealous. Instead use kstrdup and bail out,
    kfree():ing the memory used for MTD partitions and names alike
    on the errorpath.

    In the process rename the index variable from idx to i.

    Cc: Ryan Harkin
    Acked-by: Liviu Dudau
    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • This adds device tree support for AFS partitioning.

    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • This moves the AFS (ARM Firmware Suite) partition parser
    for NOR flash down into the parsers subdirectory.

    Signed-off-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Linus Walleij
     
  • The blackfin architecture has been removed a while ago, so there is
    no more need to declare uclinux_ram_map as a global structure.

    Signed-off-by: Thomas Huth
    Signed-off-by: Richard Weinberger

    Thomas Huth
     
  • When the physmap_of_core.c code was merged into physmap-core.c the
    ability to use MTD_PHYSMAP_OF with only MTD_RAM selected was lost.
    Restore this by adding MTD_RAM to the dependencies of MTD_PHYSMAP.

    Fixes: commit 642b1e8dbed7 ("mtd: maps: Merge physmap_of.c into physmap-core.c")
    Cc:
    Signed-off-by: Chris Packham
    Reviewed-by: Hamish Martin
    Signed-off-by: Richard Weinberger

    Chris Packham
     
  • When the gpio-addr-flash.c driver was merged with physmap-core.c the
    code to store the current gpio_values was lost. This meant that once a
    gpio was asserted it was never de-asserted. Fix this by storing the
    current offset in gpio_values like the old driver used to.

    Fixes: commit ba32ce95cbd9 ("mtd: maps: Merge gpio-addr-flash.c into physmap-core.c")
    Cc:
    Signed-off-by: Chris Packham
    Reviewed-by: Boris Brezillon
    Signed-off-by: Richard Weinberger

    Chris Packham
     
  • Allow matching the imagetag parser for fixed partitions defined in the
    device tree.

    Reviewed-by: Rob Herring
    Signed-off-by: Jonas Gorski
    Reviewed-by: Florian Fainelli
    Signed-off-by: Richard Weinberger

    Jonas Gorski
     
  • Move the bcm963xx Image Tag parsing into its own partition parser. This
    Allows reusing the parser with different full flash parsers.

    While moving it, rename it to bcm963* to better reflect it isn't chip,
    but reference implementation specific.

    Reviewed-by: Rob Herring
    Signed-off-by: Jonas Gorski
    Reviewed-by: Florian Fainelli
    Signed-off-by: Richard Weinberger

    Jonas Gorski
     
  • Add of_match_table support to allow using bcm63xxpart as a full flash
    layout parser from device tree.

    Reviewed-by: Rob Herring
    Signed-off-by: Jonas Gorski
    Reviewed-by: Florian Fainelli
    Signed-off-by: Richard Weinberger

    Jonas Gorski
     
  • Marking a local variable as __xipram causes a warning because of the
    noinline attribute:

    drivers/mtd/maps/physmap-gemini.c:89:11: error: '__noinline__' attribute only applies to functions [-Werror,-Wignored-attributes]
    map_word __xipram ret;
    ^
    include/linux/mtd/xip.h:34:18: note: expanded from macro '__xipram'
    #define __xipram noinline __attribute__ ((__section__ (".xiptext")))

    I can't see any reason for the anotation anyway, so just remove it here.

    Fixes: 9d3b5086f6d4 ("mtd: physmap_of_gemini: Handle pin control")
    Signed-off-by: Arnd Bergmann
    Acked-by: Linus Walleij
    Signed-off-by: Richard Weinberger

    Arnd Bergmann
     
  • SPI NOR core changes:
    - Print all JEDEC ID bytes on error
    - Fix comment of spi_nor_find_best_erase_type()
    - Add region locking flags for s25fl512s

    SPI NOR controller drivers changes:
    - intel-spi:
    * Avoid crossing 4K address boundary on read/write
    * Add support for Intel Comet Lake SPI serial flash

    Richard Weinberger
     

06 May, 2019

1 commit


05 May, 2019

1 commit

  • NAND core changes:
    - Support having the bad block markers in either the first, second or
    last page of a block. The combination of all three location is now
    possible.
    - Constification of NAND_OP_PARSER(_PATTERN) elements.
    - Generic NAND DT bindings changed to yaml format (can be used to
    check the proposed bindings. First platform to be fully supported:
    sunxi.
    - Stopped using several legacy hooks.
    - Preparation to use the generic NAND layer with the addition of
    several helpers and the removal of the struct nand_chip from generic
    functions.
    - Kconfig cleanup to prepare the introduction of external ECC engines
    support.
    - Fallthrough comments.
    - Introduction of the SPI-mem dirmap API for SPI-NAND devices.

    Raw NAND controller drivers changes:
    - nandsim:
    * Switch to ->exec-op().
    - meson:
    * Misc cleanups and fixes.
    * New OOB layout.
    - Sunxi:
    * A23/A33 NAND DMA support.
    - Ingenic:
    * Full reorganization and cleanup.
    * Clear separation between NAND controller and ECC engine.
    * Support JZ4740 an JZ4725B.
    - Denali:
    * Clear controller/chip separation.
    * ->exec_op() migration.
    * Various cleanups.
    - fsl_elbc:
    * Enable software ECC support.
    - Atmel:
    * Sam9x60 support.
    - GPMI:
    * Introduce the GPMI_IS_MXS() macro.
    - Various trivial/spelling/coding style fixes.

    Richard Weinberger
     

26 Apr, 2019

1 commit

  • Since the migration of the driver to stop using the legacy
    ->select_chip() hook, there is nothing deselecting the target anymore,
    thus the selection is not forced at the next access. Ensure the ND_RUN
    bit and the interrupts are always in a clean state.

    Cc: Daniel Mack
    Cc: stable@vger.kernel.org
    Fixes: b25251414f6e00 ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
    Suggested-by: Boris Brezillon
    Signed-off-by: Miquel Raynal
    Tested-by: Daniel Mack
    Reviewed-by: Boris Brezillon
    Signed-off-by: Richard Weinberger

    Miquel Raynal
     

18 Apr, 2019

10 commits

  • Stop using the legacy interface.

    Reviewed-by: Boris Brezillon
    Signed-off-by: Richard Weinberger
    Signed-off-by: Miquel Raynal

    Richard Weinberger
     
  • We will need struct nand_controller soon, so more stuff need to
    be parts of struct nandsim.
    While we are here, rename "nand" to "ns" to use the same naming scheme
    everywhere in nandsim.

    Reviewed-by: Boris Brezillon
    Signed-off-by: Richard Weinberger
    Signed-off-by: Miquel Raynal

    Richard Weinberger
     
  • According to the datasheet of some Cypress SLC NANDs, the bad
    block markers can be in the first, second or last page of a block.
    So let's check all three locations.

    Signed-off-by: Frieder Schrempf
    Reviewed-by: Boris Brezillon
    Reviewed-by: Miquel Raynal
    Signed-off-by: Miquel Raynal

    Frieder Schrempf
     
  • It is known that some ESMT SLC NANDs have been shipped
    with the factory bad block markers in the first or last page
    of the block, instead of the first or second page. To be on
    the safe side, let's check all three locations.

    Signed-off-by: Frieder Schrempf
    Reviewed-by: Boris Brezillon
    Reviewed-by: Miquel Raynal
    Signed-off-by: Miquel Raynal

    Frieder Schrempf
     
  • Currently supported bad block marker positions within the block are:
    * in first page only
    * in last page only
    * in first or second page

    Some ESMT NANDs are known to have been shipped by the manufacturer
    with bad block markers in the first or last page, instead of the
    first or second page.

    Also the datasheets for Cypress/Spansion/AMD NANDs claim that the
    first, second *and* last page needs to be checked.

    Therefore we make it possible to set NAND_BBM_FIRSTPAGE,
    NAND_BBM_SECONDPAGE and NAND_BBM_LASTPAGE independently in any
    combination.

    To simplify the code, the logic to evaluate the flags is moved to a
    a new function nand_bbm_get_next_page().

    Signed-off-by: Frieder Schrempf
    Reviewed-by: Boris Brezillon
    Signed-off-by: Miquel Raynal

    Frieder Schrempf
     
  • To be able to check and set bad block markers in the first and
    second page of a block independently of each other, we create
    separate flags for both cases.

    Previously NAND_BBM_SECONDPAGE meant, that both, the first and the
    second page were used. With this patch NAND_BBM_FIRSTPAGE stands for
    using the first page and NAND_BBM_SECONDPAGE for using the second
    page.

    This patch is only for preparation of subsequent changes and does
    not implement the logic to actually handle both flags separately.

    Signed-off-by: Frieder Schrempf
    Reviewed-by: Boris Brezillon
    Reviewed-by: Miquel Raynal
    Signed-off-by: Miquel Raynal

    Frieder Schrempf
     
  • The information about where the manufacturer puts the bad block
    markers inside the bad block and in the OOB data is stored in
    different places. Let's move this information to the chip struct,
    as we did it for rawnand.

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

    Frieder Schrempf
     
  • The information about where the manufacturer puts the bad block
    markers inside the bad block and in the OOB data is stored in
    different places. Let's move this information to nand_chip.options
    and nand_chip.badblockpos.

    As this chip-specific information is not directly related to the
    bad block table (BBT), we also rename the flags to NAND_BBM_*.

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

    Frieder Schrempf
     
  • Documentation/scheduler/completion.txt states:
    Calling init_completion() on the same completion object twice is
    most likely a bug as it re-initializes the queue to an empty queue and
    enqueued tasks could get "lost" - use reinit_completion() in that case,
    but be aware of other races.

    Initialize nfc->completion in meson_nfc_probe using init_completion and
    change the call in meson_nfc_queue_rb to reinit_completion so the logic
    matches what the documentation suggests.

    Signed-off-by: Martin Blumenstingl
    Tested-by:Liang Yang
    Acked-by: Liang Yang
    Tested-by:Liang Yang
    Acked-by: Liang Yang
    Signed-off-by: Miquel Raynal

    Martin Blumenstingl
     
  • This simplifies the code because it gets rid of the casts to an
    u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip.
    Also it gets rid of the cast of the u8 databuf pointer to a void
    pointer.
    The logic inside meson_nfc_dma_buffer_setup() doesn't care about the
    pointer types themselves because it only passes them to dma_map_single
    which accepts a void pointer.

    No functional changes.

    Signed-off-by: Martin Blumenstingl
    Tested-by:Liang Yang
    Acked-by: Liang Yang
    Tested-by:Liang Yang
    Acked-by: Liang Yang
    Tested-by:Liang Yang
    Acked-by: Liang Yang
    Signed-off-by: Miquel Raynal

    Martin Blumenstingl