17 Sep, 2014

1 commit

  • U-Boot has imported various source files from other projects,
    mostly Linux.

    Something like

    #ifdef __UBOOT__
    [ modification for U-Boot ]
    #else
    [ original code ]
    #endif

    is an often used strategy for clarification of adjusted parts,
    that is, easier re-sync in future.

    Instead of defining __UBOOT__ in each source file,
    passing it from the top Makefile would be easier.

    Signed-off-by: Masahiro Yamada
    Acked-by: Marek Vasut
    Acked-by: Heiko Schocher

    Masahiro Yamada
     

26 Aug, 2014

3 commits

  • snyc with linux v3.15:

    commit 1860e379875dfe7271c649058aeddffe5afd9d0d
    Author: Linus Torvalds
    Date: Sun Jun 8 11:19:54 2014 -0700

    Linux 3.15

    Signed-off-by: Heiko Schocher
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     
  • while playing with the new mtd/ubi/ubifs sync, found some
    small updates for it:

    - add del_mtd_partition() to include/linux/mtd/mtd
    - mtd: add a debug_printf
    - remove some not used functions

    Signed-off-by: Heiko Schocher
    Cc: Scott Wood
    Cc: Tom Rini

    Heiko Schocher
     
  • resync ubi subsystem with linux:

    commit 455c6fdbd219161bd09b1165f11699d6d73de11c
    Author: Linus Torvalds
    Date: Sun Mar 30 20:40:15 2014 -0700

    Linux 3.14

    A nice side effect of this, is we introduce UBI Fastmap support
    to U-Boot.

    Signed-off-by: Heiko Schocher
    Signed-off-by: Tom Rini
    Cc: Marek Vasut
    Cc: Sergey Lapin
    Cc: Scott Wood
    Cc: Joerg Krause

    Heiko Schocher
     

07 Jun, 2014

6 commits

  • This patch add support for BCH16_ECC to omap_gpmc driver.

    *need to BCH16 ECC scheme*
    With newer SLC Flash technologies and MLC NAND, and large densities, pagesizes
    Flash devices have become more suspectible to bit-flips. Thus stronger
    ECC schemes are required for protecting the data.
    But stronger ECC schemes have come with larger-sized ECC syndromes which require
    more space in OOB/Spare. This puts constrains like;
    (a) BCH16_ECC can correct 16 bit-flips per 512Bytes of data.
    (b) BCH16_ECC generates 26-bytes of ECC syndrome / 512B.
    Due to (b) this scheme can only be used with NAND devices which have enough
    OOB to satisfy following equation:
    OOBsize per page >= 26 * (page-size / 512)

    Signed-off-by: Pekon Gupta

    pekon gupta
     
  • GPMC can support simultaneous processing of 8 512Byte data chunks, in parallel

    Signed-off-by: Pekon Gupta

    pekon gupta
     
  • As per following Sections in ONFI Spec, GET_FEATURES and SET_FEATURES also need
    byte-addressing on 16-bit devices.

    *Section: Target Initialization"
    "The Read ID and Read Parameter Page commands only use the lower 8-bits of the
    data bus. The host shall not issue commands that use a word data width on x16
    devices until the host determines the device supports a 16-bit data bus width
    in the parameter page."

    *Section: Bus Width Requirements*
    "When the host supports a 16-bit bus width, only data is transferred at the
    16-bit width. All address and command line transfers shall use only the lower
    8-bits of the data bus. During command transfers, the host may place any value
    on the upper 8-bits of the data bus. During address transfers, the host shall
    set the upper 8-bits of the data bus to 00h."

    So porting following commit from linux kernel
    commit e34fcb07a6d57411de6e15a47724fbe92c5caa42
    Author: David Mosberger (preserving authorship)
    mtd: nand: fix GET/SET_FEATURES address on 16-bit devices

    Signed-off-by: Pekon Gupta

    David Mosberger
     
  • As per following Sections in ONFI Spec, NAND_CMD_READID should use only
    lower 8-bit for transfering command, address and data even on x16 NAND device.

    *Section: Target Initialization"
    "The Read ID and Read Parameter Page commands only use the lower 8-bits of the
    data bus. The host shall not issue commands that use a word data width on x16
    devices until the host determines the device supports a 16-bit data bus width
    in the parameter page."

    *Section: Bus Width Requirements*
    "When the host supports a 16-bit bus width, only data is transferred at the
    16-bit width. All address and command line transfers shall use only the lower
    8-bits of the data bus. During command transfers, the host may place any value
    on the upper 8-bits of the data bus. During address transfers, the host shall
    set the upper 8-bits of the data bus to 00h."

    Thus porting following commit from linux-kernel to ensure that column address
    is not altered to align to x16 bus when issuing NAND_CMD_READID command.

    commit 3dad2344e92c6e1aeae42df1c4824f307c51bcc7
    mtd: nand: force NAND_CMD_READID onto 8-bit bus
    Author: Brian Norris (preserving authorship)

    The NAND command helpers tend to automatically shift the column address
    for x16 bus devices, since most commands expect a word address, not a
    byte address. The Read ID command, however, expects an 8-bit address
    (i.e., 0x00, 0x20, or 0x40 should not be translated to 0x00, 0x10, or
    0x20).

    This fixes the column address for a few drivers which imitate the
    nand_base defaults.

    Signed-off-by: Pekon Gupta

    Brian Norris
     
  • This patch adds macros for following parameters of ELM Hardware engine
    - ELM_MAX_CHANNELS: ELM can process 8 data streams simultaneously
    - ELM_MAX_ERRORS: ELM can detect upto 16 ECC error when using BCH16 scheme

    Signed-off-by: Pekon Gupta
    Reviewed-by: Stefan Roese

    pekon gupta
     
  • ELM hardware engine support ECC error detection for multiple ECC strengths like
    +------+------------------------+
    |Type | ECC syndrome length |
    +------+------------------------+
    |BCH4 | 6.5 bytes = 13 nibbles |
    |BCH8 | 13 byte = 26 nibbles |
    |BCH16 | 26 bytes = 52 nibbles |
    +------+------------------------+

    Current implementation of omap_elm driver uses ECC syndrom length (in 'nibbles')
    to differentiate between BCH4/BCH8/BCH16. This patch replaces it with 'bch_type'

    Signed-off-by: Pekon Gupta
    Reviewed-by: Stefan Roese

    pekon gupta
     

18 Apr, 2014

1 commit


05 Mar, 2014

2 commits


25 Jan, 2014

1 commit


22 Nov, 2013

1 commit

  • nand_ecclayout is present in mtd.h at Linux.
    Move this structure to mtd.h to comply with Linux.

    Also, increase the ecc placement locations to 640 to suport device having
    writesize/oobsize of 8KB/640B. This means that the maximum oobsize has gone
    up to 640 bytes and consequently the maximum ecc placement locations have
    also gone up to 640.

    Changes from Prabhabkar's version (squashed into one patch to preserve
    bisectability):
    - Added _LARGE to MTD_MAX_*_ENTRIES

    This makes the names match current Linux source, and resolves
    a conflict between
    http://patchwork.ozlabs.org/patch/280488/
    and
    http://patchwork.ozlabs.org/patch/284513/

    The former was posted first and is closer to matching Linux, but
    unlike Linux it does not add _LARGE to the names. The second adds
    _LARGE to one of the names, and depends on it in a subsequent patch
    (http://patchwork.ozlabs.org/patch/284512/).

    - Made max oobfree/eccpos configurable, and used this on tricorder,
    alpr, ASH405, T4160QDS, and T4240QDS (these boards failed to build
    for me without doing so, due to a size increase).

    On tricorder SPL, this saves 2576 bytes (and makes the SPL build
    again) versus the new default of 640 eccpos and 32 oobfree, and
    saves 336 bytes versus the old default of 128 eccpos and 8 oobfree.

    Signed-off-by: Prabhakar Kushwaha
    CC: Vipin Kumar
    [scottwood@freescale.com: changes as described above]
    Signed-off-by: Scott Wood
    Cc: Thomas Weber
    Cc: Matthias Fuchs
    Cc: Stefan Roese
    Cc: York Sun
    Cc: Tom Rini
    Reviewed-by: Stefan Roese

    Prabhakar Kushwaha
     

10 Oct, 2013

1 commit

  • Linux modified the MTD driver interface in commit edbc4540 (with the
    same name as this commit). The effect is that calls to mtd_read will
    not return -EUCLEAN if the number of ECC-corrected bit errors is below
    a certain threshold, which defaults to the strength of the ECC. This
    allows -EUCLEAN to stop indicating "some bits were corrected" and begin
    indicating "a large number of bits were corrected, the data held in
    this region of flash may be lost soon". UBI makes use of this and when
    -EUCLEAN is returned from mtd_read it will move data to another block
    of flash. Without adopting this interface change UBI on U-boot attempts
    to move data between blocks every time a single bit is corrected using
    the ECC, which is a very common occurance on some devices.

    For some devices where bit errors are common enough, UBI can get stuck
    constantly moving data around because each block it attempts to use has
    a single bit error. This condition is hit when wear_leveling_worker
    attempts to move data from one PEB to another in response to an
    -EUCLEAN/UBI_IO_BITFLIPS error. When this happens ubi_eba_copy_leb is
    called to perform the data copy, and after the data is written it is
    read back to check its validity. If that read returns UBI_IO_BITFLIPS
    (in response to an MTD -EUCLEAN) then ubi_eba_copy_leb returns 1 to
    wear_leveling worker, which then proceeds to schedule the destination
    PEB for erasure. This leads to erase_worker running on the PEB, and
    following a successful erase wear_leveling_worker is called which
    begins this whole cycle all over again. The end result is that (without
    UBI debug output enabled) the boot appears to simply hang whilst in
    reality U-boot busily works away at destroying a block of the NAND
    flash. Debug output from this situation:

    UBI DBG: ensure_wear_leveling: schedule scrubbing
    UBI DBG: wear_leveling_worker: scrub PEB 1027 to PEB 4083
    UBI DBG: ubi_io_read_vid_hdr: read VID header from PEB 1027
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 1027:4096
    UBI DBG: ubi_eba_copy_leb: copy LEB 0:0, PEB 1027 to PEB 4083
    UBI DBG: ubi_eba_copy_leb: read 1040384 bytes of data
    UBI DBG: ubi_io_read: read 1040384 bytes from PEB 1027:8192
    UBI: fixable bit-flip detected at PEB 1027
    UBI DBG: ubi_io_write_vid_hdr: write VID header to PEB 4083
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:4096
    UBI DBG: ubi_io_read_vid_hdr: read VID header from PEB 4083
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 4083:4096
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:8192
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 4083:8192
    UBI: fixable bit-flip detected at PEB 4083
    UBI DBG: schedule_erase: schedule erasure of PEB 4083, EC 55, torture 0
    UBI DBG: erase_worker: erase PEB 4083 EC 55
    UBI DBG: sync_erase: erase PEB 4083, old EC 55
    UBI DBG: do_sync_erase: erase PEB 4083
    UBI DBG: sync_erase: erased PEB 4083, new EC 56
    UBI DBG: ubi_io_write_ec_hdr: write EC header to PEB 4083
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:0
    UBI DBG: ensure_wear_leveling: schedule scrubbing
    UBI DBG: wear_leveling_worker: scrub PEB 1027 to PEB 4083
    ...

    This patch adopts the interface change as in Linux commit edbc4540 in
    order to avoid such situations. Given that none of the drivers under
    drivers/mtd return -EUCLEAN, this should only affect those using
    software ECC. I have tested that it works on a board which is
    currently out of tree, but which I hope to be able to begin
    upstreaming soon.

    Signed-off-by: Paul Burton
    Acked-by: Stefan Roese

    Paul Burton
     

24 Jul, 2013

1 commit


01 Jun, 2013

2 commits

  • Tom Rini
     
  • This patch is essentially an update of u-boot MTD subsystem to
    the state of Linux-3.7.1 with exclusion of some bits:

    - the update is concentrated on NAND, no onenand or CFI/NOR/SPI
    flashes interfaces are updated EXCEPT for API changes.

    - new large NAND chips support is there, though some updates
    have got in Linux-3.8.-rc1, (which will follow on top of this patch).

    To produce this update I used tag v3.7.1 of linux-stable repository.

    The update was made using application of relevant patches,
    with changes relevant to U-Boot-only stuff sticked together
    to keep bisectability. Then all changes were grouped together
    to this patch.

    Signed-off-by: Sergey Lapin
    [scottwood@freescale.com: some eccstrength and build fixes]
    Signed-off-by: Scott Wood

    Sergey Lapin
     

06 May, 2013

1 commit

  • This patch adds a driver for the diskonchip G4 nand flash device. It is based
    on the driver from the linux kernel.

    This also includes a separate SPL driver. A separate SPL driver is used because
    the device operates in a different mode (reliable mode) when loading a boot
    image, and also because the storage format of the boot image is different from
    normal data (pages are stored redundantly). The SPL driver basically mimics how
    a typical IPL reads data from the device. The special operating mode and
    storage format are used to compensate for the fact that the IPL does not contain
    the BCH ecc decoding algorithm (due to size constraints). Although the u-boot
    SPL *could* use ecc, it operates like an IPL for the sake of simplicity and
    uniformity, since the IPL and SPL share the task of loading the u-boot image.
    As a side benefit, the SPL driver is very small.

    [port from linux kernel 3.4 commit 570469f3bde7f71cc1ece07a18d54a05b6a8775d]

    Signed-off-by: Mike Dunn

    Mike Dunn
     

02 Apr, 2013

1 commit

  • 'bool' is defined in random places. This patch consolidates them into a
    single header file include/linux/types.h, using stdbool.h introduced in C99.

    All other #define, typedef and enum are removed. They are all consistent with
    true = 1, false = 0.

    Replace FALSE, False with false. Replace TRUE, True with true.
    Skip *.py, *.php, lib/* files.

    Signed-off-by: York Sun

    York Sun
     

27 Nov, 2012

1 commit


05 Nov, 2012

1 commit

  • include/linux/compat.h:4:9: warning: preprocessor token __user redefined
    include/linux/compiler.h:7:10: this was the original definition
    include/linux/compat.h:5:9: warning: preprocessor token __iomem redefined
    include/linux/compiler.h:12:10: this was the original definition

    fixup __iomem, __user definitions in compat.h code appears to be placed
    there as a cover up from a code import from linux when u-boot didn't yet
    have a compiler.h, introduced by commit
    932394ac43e2e778e664eeb6e456fecd0fae6e59 "Rewrite of NAND code based on
    what is in 2.6.12 Linux kernel".

    Signed-off-by: Kim Phillips

    Kim Phillips
     

22 Sep, 2012

1 commit


18 Sep, 2012

2 commits

  • This is based on Linux kernel -next:

    commit 14f44abf1dafc20ba42ce8616a8fc8fbd1b3712b
    Author: Brian Norris
    Date: Fri Jul 13 09:28:24 2012 -0700

    mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

    The NAND_CHIPOPTIONS_MSK has limited utility and is causing real bugs. It
    silently masks off at least one flag that might be set by the driver
    (NAND_NO_SUBPAGE_WRITE). This breaks the GPMI NAND driver and possibly
    others.

    Really, as long as driver writers exercise a small amount of care with
    NAND_* options, this mask is not necessary at all; it was only here to
    prevent certain options from accidentally being set by the driver. But the
    original thought turns out to be a bad idea occasionally. Thus, kill it.

    Note, this patch fixes some major gpmi-nand breakage.

    Signed-off-by: Marek Vasut
    Cc: Brian Norris
    Cc: Eric Nelson
    Cc: Fabio Estevam
    Cc: Otavio Salvador
    Cc: Scott Wood
    Signed-off-by: Scott Wood

    Marek Vasut
     
  • NAND_CMD_ constants for lock/unlock should be in the header

    Signed-off-by: Joe Hershberger
    Signed-off-by: Scott Wood

    Joe Hershberger
     

08 Sep, 2012

1 commit

  • The NAND layer needs to use cache-aligned buffers by default. Towards this
    goal. align the default buffers and their members according to the minimum
    DMA alignment defined for the architecture.

    Signed-off-by: Simon Glass
    Signed-off-by: Tom Warren
    Acked-by: Scott Wood

    Simon Glass
     

07 Jul, 2012

3 commits

  • Signed-off-by: Amit Virdi
    Signed-off-by: Stefan Roese

    Amit Virdi
     
  • SMI is the serial memory interface controller provided by ST.

    Earlier, a driver exists in the u-boot source code for the SMI IP. However, it
    was specific to spear platforms. This commit converts the same driver to a more
    generic driver. As a result, the driver files are renamed to st_smi.c and
    st_smi.h and moved into drivers/mtd folder for reusability by other platforms
    using smi controller peripheral.

    Signed-off-by: Vipin Kumar
    Signed-off-by: Amit Virdi
    Signed-off-by: Stefan Roese

    Vipin KUMAR
     
  • Flexible static memory controller is a peripheral provided by ST,
    which controls the access to NAND chips along with many other
    memory device chips eg NOR, SRAM.

    This patch adds the driver support for FSMC controller interfacing
    with NAND memory.

    Signed-off-by: Vipin Kumar
    Signed-off-by: Amit Virdi
    Signed-off-by: Stefan Roese
    Acked-by: Scott Wood

    Vipin KUMAR
     

30 Apr, 2012

1 commit


04 Apr, 2012

2 commits


29 Feb, 2012

2 commits

  • commit 2a8e0fc8b3dc31a3c571e439fbf04b882c8986be ("nand: Merge changes
    from Linux nand driver") accidentally reverted commit
    13f0fd94e3cae6f8a0d9fba5d367e311edc8ebde ("NAND: Scan bad blocks
    lazily.").

    Reinstate the change, as amended by commit
    ff49ea8977b56916edd5b1766d9939010e30b181 ("NAND: Mark the BBT as scanned
    prior to calling scan_bbt.").

    Signed-off-by: Scott Wood

    Scott Wood
     
  • This reverts commit 4fee6c2f295f932b8febdc7ce8731ba045695fa5.

    It breaks boards that currently rely on soft-ecc, as pointed out here:
    http://patchwork.ozlabs.org/patch/140872/

    The reverted patch should be resubmitted with documentation, and with the
    CONFIG_MTD_ECC_SOFT selected from every board that needs it. We could
    start by looking at what NAND driver the board selects, and whether
    that driver ever asks for soft ECC.

    Signed-off-by: Scott Wood

    Scott Wood
     

27 Jan, 2012

4 commits


07 Dec, 2011

1 commit

  • Functions often used in SPL are now part of linux/mtd/nand.h.
    Static modifiers are removed from these functions in
    drivers/mtd/nand/nand_base.c.

    Signed-off-by: Simon Schwarz
    Cc: scottwood@freescale.com
    Cc: s-paulraj@ti.com
    Cc: albert.u.boot@aribaud.net
    Acked-by: Scott Wood

    Simon Schwarz