07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

04 Dec, 2017

1 commit

  • This header was renamed to rawnand.h in Linux.

    The following is the corresponding commit in Linux.

    commit d4092d76a4a4e57b65910899948a83cc8646c5a5
    Author: Boris Brezillon
    Date: Fri Aug 4 17:29:10 2017 +0200

    mtd: nand: Rename nand.h into rawnand.h

    We are planning to share more code between different NAND based
    devices (SPI NAND, OneNAND and raw NANDs), but before doing that
    we need to move the existing include/linux/mtd/nand.h file into
    include/linux/mtd/rawnand.h so we can later create a nand.h header
    containing all common structure and function prototypes.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

12 Jul, 2017

2 commits


16 Jun, 2017

1 commit


29 Mar, 2017

1 commit


25 Jul, 2016

1 commit


22 Jul, 2016

1 commit


04 Jun, 2016

2 commits

  • nand_info[] is now an array of pointers, with the actual mtd_info
    instance embedded in struct nand_chip.

    This is in preparation for syncing the NAND code with Linux 4.6,
    which makes the same change to struct nand_chip. It's in a separate
    commit due to the large amount of changes required to accommodate the
    change to nand_info[].

    Signed-off-by: Scott Wood

    Scott Wood
     
  • This typedef serves no purpose other than causing confusion with
    struct nand_chip.

    Signed-off-by: Scott Wood

    Scott Wood
     

19 Jan, 2016

1 commit

  • In a number of places we had wordings of the GPL (or LGPL in a few
    cases) license text that were split in such a way that it wasn't caught
    previously. Convert all of these to the correct SPDX-License-Identifier
    tag.

    Signed-off-by: Tom Rini

    Tom Rini
     

31 Mar, 2015

3 commits

  • This command is only enabled by one board, complicates the NAND code,
    and doesn't appear to have been functioning properly for several
    years. If there are no bad blocks in the NAND region being written
    nand_write_skip_bad() will take the shortcut of calling nand_write()
    which bypasses the special yaffs handling. This causes invalid YAFFS
    data to be written. See
    http://lists.denx.de/pipermail/u-boot/2011-September/102830.html for
    an example and a potential workaround.

    U-Boot still retains the ability to mount and access YAFFS partitions
    via CONFIG_YAFFS2.

    Signed-off-by: Peter Tyser

    Peter Tyser
     
  • Add nand_verify() and nand_verify_page_oob(). nand_verify() verifies
    NAND contents against an arbitrarily sized buffer using ECC while
    nand_verify_page_oob() verifies a NAND page's contents and OOB.

    Signed-off-by: Peter Tyser
    Tested-by: Heiko Schocher
    Acked-by: Heiko Schocher

    Peter Tyser
     
  • The use of the nand_write_options and nand_read_options structures were
    removed in commit dfbf617ff055e4216f78d358b0867c548916d14b. Remove the
    now-unused structures too.

    Signed-off-by: Peter Tyser

    Peter Tyser
     

17 Nov, 2014

1 commit


10 Mar, 2014

1 commit


15 Oct, 2013

1 commit


24 Jul, 2013

1 commit


25 Jun, 2013

1 commit

  • before writing the received buffer to nand, erase the nand
    sectors. If not doing this, nand write fails. See for
    more info here:

    http://lists.denx.de/pipermail/u-boot/2013-June/156361.html

    Using the nand erase option "spread", maybe overwrite
    blocks on, for example another mtd partition, if the
    erasing range contains bad blocks.
    So a limit option is added to nand_erase_opts()

    Signed-off-by: Heiko Schocher
    Cc: Scott Wood
    Cc: Pantelis Antoniou
    Cc: Lukasz Majewski
    Cc: Kyungmin Park
    Cc: Marek Vasut
    Cc: Tom Rini
    Signed-off-by: Scott Wood

    Heiko Schocher
     

01 Jun, 2013

1 commit

  • 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
     

23 May, 2013

1 commit


10 Apr, 2013

1 commit

  • We make these two functions take a size_t pointer to how much space
    was used on NAND to read or write the buffer (when reads/writes happen)
    so that bad blocks can be accounted for. We also make them take an
    loff_t limit on how much data can be read or written. This means that
    we can now catch the case of when writing to a partition would exceed
    the partition size due to bad blocks. To do this we also need to make
    check_skip_len count not just complete blocks used but partial ones as
    well. All callers of nand_(read|write)_skip_bad are adjusted to call
    these with the most sensible limits available.

    The changes were started by Pantelis and finished by Tom.

    Signed-off-by: Pantelis Antoniou
    Signed-off-by: Tom Rini

    Tom Rini
     

27 Nov, 2012

1 commit

  • This patch adds a NAND Flash torture feature, which is useful as a block stress
    test to determine if a block is still good and reliable (or should be marked as
    bad), e.g. after a write error.

    This code is ported from mtd-utils' lib/libmtd.c.

    Signed-off-by: Benoît Thébaudeau
    Cc: Scott Wood
    [scottwood@freescale.com: removed unnec. ifdef and unwrapped error strings]
    Signed-off-by: Scott Wood

    Benoît Thébaudeau
     

18 Sep, 2012

3 commits


01 Sep, 2012

1 commit


30 Apr, 2012

1 commit


27 Jan, 2012

2 commits

  • This driver doesn't yet make use of the added flexibility (not that that
    should stop anyone from converting...), but it will with the in-progress
    hack to support 4k-page NAND.

    Signed-off-by: Scott Wood

    Scott Wood
     
  • This allows a driver to run code between nand_scan_ident() and
    nand_scan_tail(), among other things. See the additions to
    doc/README.nand for details.

    To allow a gradual transition, Boards that don't set
    CONFIG_SYS_NAND_SELF_INIT will still be initialized the old way, but
    new drivers should not require this, and existing drivers should be
    converted when convenient.

    Signed-off-by: Scott Wood

    Scott Wood
     

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
     

01 Oct, 2011

2 commits


02 Jul, 2011

3 commits

  • Add a flag to nand_read_skip_bad() such that if true, any trailing
    pages in an eraseblock whose contents are entirely 0xff will be
    dropped.

    The implementation is via a new drop_ffs() function which is
    based on the function of the same name from the ubiformat
    utility by Artem Bityutskiy.

    This is as-per the reccomendations of the UBI FAQ [1]

    [1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo

    Signed-off-by: Ben Gardiner
    CC: Artem Bityutskiy
    Acked-by: Detlev Zundel
    CC: Scott Wood
    Signed-off-by: Scott Wood

    Ben Gardiner
     
  • When specified in the flags argument of nand_write, WITH_YAFFS_OOB causes an
    operation which is mutually exclusive with the 'usual' way of writing.

    Add a check that client code does not specify WITH_YAFFS_OOB along with any
    other flags and add a comment indicating that the WITH_YAFFS_OOB flag should
    not be mixed with other flags.

    Signed-off-by: Ben Gardiner
    CC: Scott Wood
    Signed-off-by: Scott Wood

    Ben Gardiner
     
  • In a future commit the behaviour of nand_write_skip_bad()
    will be further extended.

    Convert the only flag currently passed to the nand_write_
    skip_bad() function to a bitfield of only one allocated
    member. This should avoid an explosion of int's at the
    end of the parameter list or the ambiguous calls like

    nand_write_skip_bad(info, offset, len, buf, 0, 1, 1);
    nand_write_skip_bad(info, offset, len, buf, 0, 1, 0);

    Instead there will be:

    nand_write_skip_bad(info, offset, len, buf, WITH_YAFFS_OOB |
    WITH_OTHER);

    Signed-off-by: Ben Gardiner
    Acked-by: Detlev Zundel
    Signed-off-by: Scott Wood

    Ben Gardiner
     

13 Jan, 2011

1 commit


12 Oct, 2010

1 commit

  • A while back, in http://lists.denx.de/pipermail/u-boot/2009-June/054428.html,
    Michele De Candia posted a patch to not count bad blocks toward the
    requested size to be erased. This is desireable when you're passing in
    something like $filesize, but not when you're trying to erase a partition.

    Thus, a .spread subcommand (named for consistency with
    http://lists.denx.de/pipermail/u-boot/2010-August/075163.html) is introduced
    to make explicit the user's desire to erase for a given amount of data,
    rather than to erase a specific region of the chip.

    While passing $filesize to "nand erase" is useful, accidentally passing
    something like $fliesize currently produces quite unpleasant results, as the
    variable evaluates to nothing and U-Boot assumes that you want to erase
    the entire rest of the chip/partition. To improve the safety of the
    erase command, require the user to make explicit their intentions by
    using a .part or .chip subcommand. This is an incompatible user interface
    change, but keeping compatibility would eliminate the safety gain, and IMHO
    it's worth it.

    While touching nand_erase_opts(), make it accept 64-bit offsets and sizes,
    fix the percentage display when erase length is rounded up, eliminate
    an inconsistent warning about rounding up the erase length which only
    happened when the length was less than one block (rounding up for $filesize
    is normal operation), and add a diagnostic if there's an attempt to erase
    beginning at a non-block boundary.

    Signed-off-by: Scott Wood
    Tested-by: Ben Gardiner

    Scott Wood
     

13 Jul, 2010

1 commit

  • This is a re-submission of the patch by Harald Welte
    with minor modifications for rebase and changes
    as suggested by Scott Wood [1] [2].

    This patch enables the environment partition to have a run-time dynamic
    location (offset) in the NAND flash. The reason for this is simply that
    all NAND flashes have factory-default bad blocks, and a fixed compile
    time offset would mean that sometimes the environment partition would
    live inside factory bad blocks. Since the number of factory default
    blocks can be quite high (easily 1.3MBytes in current standard
    components), it is not economic to keep that many spare blocks inside
    the environment partition.

    With this patch and CONFIG_ENV_OFFSET_OOB enabled, the location of the
    environment partition is stored in the out-of-band (OOB) data of the
    first block in flash. Since the first block is where most systems boot
    from, the vendors guarantee that the first block is not a factory
    default block.

    This patch introduces the 'nand env.oob' command, which can be called
    from the u-boot command line. 'nand env.oob get' reads the address of
    the environment partition from the OOB data, 'nand env.oob set
    {offset,partition-name}' allows the setting of the marker by specifying
    a numeric offset or a partition name.

    [1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/43916
    [2] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/79195

    Signed-off-by: Ben Gardiner
    Acked-by: Harald Welte

    Ben Gardiner
     

17 Jul, 2009

1 commit

  • Legacy NAND had been scheduled for removal. Any boards that use this
    were already not building in the previous release due to an #error.

    The disk on chip code in common/cmd_doc.c relies on legacy NAND,
    and it has also been removed. There is newer disk on chip code
    in drivers/mtd/nand; someone with access to hardware and sufficient
    time and motivation can try to get that working, but for now disk
    on chip is not supported.

    Signed-off-by: Scott Wood

    Scott Wood