22 Jul, 2014

2 commits


12 Jul, 2014

1 commit

  • Some new Micron flash chips require reading the flag status register to
    determine when operations have completed.

    Furthermore, chips with multi-die stacks of the 65nm 256Mb QSPI also
    require reading the status register before reading the flag status
    register.

    This patch adds support for the flag status register in the n25q512ax3
    and n25q00 Micron QSPI flash chips.

    Signed-off-by: Graham Moore
    Signed-off-by: Brian Norris

    grmoore@altera.com
     

09 Jul, 2014

1 commit

  • In addition to mtd_block_isbad(), which checks if a block is bad or
    reserved, it's needed to check if a block is reserved only (but not
    bad). This commit adds an MTD interface for it, in a similar fashion to
    mtd_block_isbad().

    While here, fix mtd_block_isbad() so the out-of-bounds checking is done
    before the callback check.

    Signed-off-by: Ezequiel Garcia
    Tested-by: Pekon Gupta
    Signed-off-by: Brian Norris

    Ezequiel Garcia
     

11 Jun, 2014

1 commit

  • Pull MTD updates from Brian Norris:
    - refactor m25p80.c driver for use as a general SPI NOR framework for
    other drivers which may speak to SPI NOR flash without providing full
    SPI support (i.e., not part of drivers/spi/)
    - new Freescale QuadSPI driver (utilizing new SPI NOR framework)
    - updates for the STMicro "FSM" SPI NOR driver
    - fix sync/flush behavior on mtd_blkdevs
    - fixup subpage write support on a few NAND drivers
    - correct the MTD OOB test for odd-sized OOB areas
    - add BCH-16 support for OMAP NAND
    - fix warnings and trivial refactoring
    - utilize new ECC DT bindings in pxa3xx NAND driver
    - new LPDDR NVM driver
    - address a few assorted bugs caught by Coverity
    - add new imx6sx support for GPMI NAND
    - use a bounce buffer for NAND when non-DMA-able buffers are used

    * tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd: (77 commits)
    mtd: gpmi: add gpmi support for imx6sx
    mtd: maps: remove check for CONFIG_MTD_SUPERH_RESERVE
    mtd: bf5xx_nand: use the managed version of kzalloc
    mtd: pxa3xx_nand: make the driver work on big-endian systems
    mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
    mtd: nand: r852: correct write_buf loop bounds
    mtd: nand_bbt: handle error case for nand_create_badblock_pattern()
    mtd: nand_bbt: remove unused variable
    mtd: maps: sc520cdp: fix warnings
    mtd: slram: fix unused variable warning
    mtd: pfow: remove unused variable
    mtd: lpddr: fix Kconfig dependency, for I/O accessors
    mtd: nand: pxa3xx: Add supported ECC strength and step size to the DT binding
    mtd: nand: pxa3xx: Use ECC strength and step size devicetree binding
    mtd: nand: pxa3xx: Clean pxa_ecc_init() error handling
    mtd: nand: Warn the user if the selected ECC strength is too weak
    mtd: nand: omap: Documentation: How to select correct ECC scheme for your device ?
    mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
    mtd: nand: omap: add support for BCH16_ECC - ELM driver updates
    mtd: nand: omap: add support for BCH16_ECC - GPMC driver updates
    ...

    Linus Torvalds
     

28 May, 2014

1 commit

  • Fixes warning:

    In file included from drivers/mtd/lpddr/qinfo_probe.c:31:0:
    include/linux/mtd/pfow.h: In function ‘send_pfow_command’:
    include/linux/mtd/pfow.h:104:6: warning: variable ‘chipnum’ set but not used [-Wunused-but-set-variable]
    int chipnum;
    ^

    Signed-off-by: Brian Norris

    Brian Norris
     

21 May, 2014

1 commit

  • nand_base can be passed a kmap()'d buffers from highmem by
    filesystems like jffs2. This results in failure to map the
    physical address of the DMA buffer on various contoller
    driver on different platforms. This change adds a chip option
    to use preallocated databuf as bounce buffers used in
    nand_do_read_ops() and nand_do_write_ops().
    This allows for specific nand controller driver to set this
    option as needed.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Brian Norris

    Kamal Dasu
     

10 May, 2014

1 commit

  • The nand_chip::erase_cmd callback previously served a dual purpose; for
    one, it allowed a per-flash-chip override, so that AG-AND devices could
    use a different erase command than other NAND. These AND devices were
    dropped in commit 14c6578683367b1e7af0c3c09e872b45a45183a7 (mtd: nand:
    remove AG-AND support). On the other hand, some drivers (denali and
    doc-g4) need to use this sort of callback to implement
    controller-specific erase operations.

    To make the latter operation easier for some drivers (e.g., ST's new BCH
    NAND driver), it helps if the command dispatch and wait functions can be
    lumped together, rather than called separately.

    This patch does two things:
    1. Pull the call to chip->waitfunc() into chip->erase_cmd(), and return
    the status from this callback
    2. Rename erase_cmd() to just erase(), since this callback does a
    little more than just send a command

    Signed-off-by: Brian Norris
    Tested-by: Lee Jones

    Brian Norris
     

19 Apr, 2014

1 commit

  • shiraz.hashim@st.com email-id doesn't exist anymore as he has left the
    company. Replace ST's id with shiraz.linux.kernel@gmail.com.

    It also updates .mailmap file to fix address for 'git shortlog'.

    Signed-off-by: Viresh Kumar
    Cc: Shiraz Hashim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Viresh Kumar
     

15 Apr, 2014

8 commits

  • serial_flash_cmds.h defines our opcodes a little differently. Let's
    borrow its naming, since it's borrowed from the SFDP standard, and it's
    more extensible.

    This prepares us for merging serial_flash_cmds.h and spi-nor.h opcode
    listing.

    Signed-off-by: Brian Norris
    Reviewed-by: Marek Vasut
    Acked-by: Huang Shijie

    Brian Norris
     
  • Qualify these with a better namespace, and prepare them for use in more
    drivers.

    Signed-off-by: Brian Norris
    Reviewed-by: Marek Vasut
    Acked-by: Huang Shijie

    Brian Norris
     
  • Spacing is a little non-standard here. Fix up tabs vs. spaces.

    Signed-off-by: Brian Norris
    Acked-by: Huang Shijie
    Reviewed-by: Marek Vasut

    Brian Norris
     
  • Add the copyright information for spi-nor.c and spi-nor.h.

    Signed-off-by: Huang Shijie
    Signed-off-by: Brian Norris

    Huang Shijie
     
  • Add the spi_nor_match_id() to find the proper spi_device_id with the
    NOR flash's name in the spi_nor_ids table.

    Signed-off-by: Huang Shijie
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Huang Shijie
     
  • This patch cloned most of the m25p80.c. In theory, it adds a new spi-nor layer.

    Before this patch, the layer is like:

    MTD
    ------------------------
    m25p80
    ------------------------
    spi bus driver
    ------------------------
    SPI NOR chip

    After this patch, the layer is like:
    MTD
    ------------------------
    spi-nor
    ------------------------
    m25p80
    ------------------------
    spi bus driver
    ------------------------
    SPI NOR chip

    With the spi-nor controller driver(Freescale Quadspi), it looks like:
    MTD
    ------------------------
    spi-nor
    ------------------------
    fsl-quadspi
    ------------------------
    SPI NOR chip

    New APIs:
    spi_nor_scan: used to scan a spi-nor flash.

    Signed-off-by: Huang Shijie
    Acked-by: Marek Vasut
    [Brian: rebased to include additional m25p_ids[] entry]
    Signed-off-by: Brian Norris

    Huang Shijie
     
  • The spi_nor{} is cloned from the m25p{}.
    The spi_nor{} can be used by both the m25p80 and spi-nor controller.

    We also add the spi_nor_xfer_cfg{} which can be used by the two
    fundamental primitives: read_xfer/write_xfer.

    1) the hooks for spi_nor{}:
    @prepare/unpreare: used to do some work before or after the
    read/write/erase/lock/unlock.
    @read_xfer/write_xfer: We can use these two hooks to code all
    the following hooks if the driver tries to implement them
    by itself.
    @read_reg: used to read the registers, such as read status register,
    read configure register.
    @write_reg: used to write the registers, such as write enable,
    erase sector.
    @read_id: read out the ID info.
    @wait_till_ready: wait till the NOR becomes ready.
    @read: read out the data from the NOR.
    @write: write data to the NOR.
    @erase: erase a sector of the NOR.

    2) Add a new field sst_write_second for the SST NOR write.

    Signed-off-by: Huang Shijie
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Huang Shijie
     
  • This patch adds a new header :spi-nor.h,
    and copies all the SPI NOR commands and relative macros into this new header.

    This hearder can be used by the m25p80.c and other spi-nor controller,
    such as Freescale's Quadspi.

    Signed-off-by: Huang Shijie
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Huang Shijie
     

26 Mar, 2014

1 commit


11 Mar, 2014

9 commits


21 Jan, 2014

3 commits


15 Jan, 2014

1 commit

  • According to the Open NAND Flash Interface Specification (ONFI) Revision
    3.1 "Parameters are always transferred on the lower 8-bits of the data
    bus." for the Get Features and Set Features commands.

    So using read_buf and write_buf is wrong for 16-bit wide nand chips as
    they use I/O[15:0]. The Get Features command is easily fixed using 4
    times the read_byte callback. For Set Features implement a new
    overwritable callback "write_byte". Still I expect the default to work
    just fine for all controllers and making it overwriteable was just done
    for symmetry.

    Signed-off-by: Uwe Kleine-König
    [Brian: fixed warning]
    Tested-by: Brian Norris
    Signed-off-by: Brian Norris

    Uwe Kleine-König
     

14 Jan, 2014

4 commits

  • To be consistent with the rest of include/linux/mtd/nand.h, we should
    use the __packed shorthand instead of __attribute__((packed)).

    Signed-off-by: Brian Norris
    Acked-by: Huang Shijie

    Brian Norris
     
  • Micron provides READ RETRY support via the ONFI vendor-specific
    parameter block (to indicate how many read-retry modes are available)
    and the ONFI {GET,SET}_FEATURES commands with a vendor-specific feature
    address (to support reading/switching the current read-retry mode).

    The recommended sequence is as follows:

    1. Perform PAGE_READ operation
    2. If no ECC error, we are done
    3. Run SET_FEATURES with feature address 89h, mode 1
    4. Retry PAGE_READ operation
    5. If ECC error and there are remaining supported modes, increment the
    mode and return to step 3. Otherwise, this is a true ECC error.
    6. Run SET_FEATURES with feature address 89h, mode 0, to return to the
    default state.

    This patch implements the chip->setup_read_retry() callback for
    Micron and fills in the chip->read_retries.

    Tested on Micron MT29F32G08CBADA, which supports 8 read-retry modes.

    The Micron vendor-specific table was checked against the datasheets for
    the following Micron NAND:

    Needs retry Cell-type Part number Vendor revision Byte 180
    ----------- --------- ---------------- --------------- ------------
    No SLC MT29F16G08ABABA 1 Reserved (0)
    No MLC MT29F32G08CBABA 1 Reserved (0)
    No SLC MT29F1G08AACWP 1 0
    Yes MLC MT29F32G08CBADA 1 08h
    Yes MLC MT29F64G08CBABA 2 08h

    Signed-off-by: Brian Norris
    Acked-by: Huang Shijie

    Brian Norris
     
  • Modern MLC (and even SLC?) NAND can experience a large number of
    bitflips (beyond the recommended correctability capacity) due to drifts
    in the voltage threshold (Vt). These bitflips can cause ECC errors to
    occur well within the expected lifetime of the flash. To account for
    this, some manufacturers provide a mechanism for shifting the Vt
    threshold after a corrupted read.

    The generic pattern seems to be that a particular flash has N read retry
    modes (where N = 0, traditionally), and after an ECC failure, the host
    should reconfigure the flash to use the next available mode, then retry
    the read operation. This process repeats until all bitfips can be
    corrected or until the host has tried all available retry modes.

    This patch adds the infrastructure support for a
    vendor-specific/flash-specific callback, used for setting the read-retry
    mode (i.e., voltage threshold).

    For now, this patch always returns the flash to mode 0 (the default
    mode) after a successful read-retry, according to the flowchart found in
    Micron's datasheets. This may need to change in the future if it is
    determined that eventually, mode 0 is insufficient for the majority of
    the flash cells (and so for performance reasons, we should leave the
    flash in mode 1, 2, etc.).

    Signed-off-by: Brian Norris
    Acked-by: Huang Shijie

    Brian Norris
     
  • Signed-off-by: Brian Norris
    Acked-by: Huang Shijie

    Brian Norris
     

04 Jan, 2014

4 commits


07 Nov, 2013

1 commit