06 Aug, 2013

3 commits

  • Zaurus 5500 contains 2 LH28F640BFHE-PTTL90 (64M 4Mx16) and
    the LH28F640BFHE-PTTL90.pdf datasheet available on the net shows
    the exact erasesize and the OTP support.
    At the moment only jedec_probe can discover the chip and
    the NOR is mounted read only probably because of wrong vpp.

    Signed-off-by: Andrea Adami
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Andrea Adami
     
  • This reduces the size of the stack frame when calling request_module().
    Performing the sprintf before the call is not needed.

    Signed-off-by: Kees Cook
    Acked-by: Rusty Russell
    Reviewed-by: James Hogan
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Kees Cook
     
  • Print out the @adr when the write timeout occurs.
    This is useful to check if the write timeouts occur at the
    same address.

    Signed-off-by: Huang Shijie
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Huang Shijie
     

10 May, 2013

1 commit

  • Pull MTD update from David Woodhouse:

    - Lots of cleanups from Artem, including deletion of some obsolete
    drivers

    - Support partitions larger than 4GiB in device tree

    - Support for new SPI chips

    * tag 'for-linus-20130509' of git://git.infradead.org/linux-mtd: (83 commits)
    mtd: omap2: Use module_platform_driver()
    mtd: bf5xx_nand: Use module_platform_driver()
    mtd: denali_dt: Remove redundant use of of_match_ptr
    mtd: denali_dt: Change return value to fix smatch warning
    mtd: denali_dt: Use module_platform_driver()
    mtd: denali_dt: Fix incorrect error check
    mtd: nand: subpage write support for hardware based ECC schemes
    mtd: omap2: use msecs_to_jiffies()
    mtd: nand_ids: use size macros
    mtd: nand_ids: improve LEGACY_ID_NAND macro a bit
    mtd: add 4 Toshiba nand chips for the full-id case
    mtd: add the support to parse out the full-id nand type
    mtd: add new fields to nand_flash_dev{}
    mtd: sh_flctl: Use of_match_ptr() macro
    mtd: gpio: Use of_match_ptr() macro
    mtd: gpio: Use devm_kzalloc()
    mtd: davinci_nand: Use of_match_ptr()
    mtd: dataflash: Use of_match_ptr() macro
    mtd: remove h720x flash support
    mtd: onenand: remove OneNAND simulator
    ...

    Linus Torvalds
     

05 Apr, 2013

1 commit

  • The MTD subsystem has historically tried to be as configurable as possible. The
    side-effect of this is that its configuration menu is rather large, and we are
    gradually shrinking it. For example, we recently merged partitions support with
    the mtdcore.

    This patch does the next step - it merges the mtdchar module to mtdcore. And in
    this case this is not only about eliminating too fine-grained separation and
    simplifying the configuration menu. This is also about eliminating seemingly
    useless kernel module.

    Indeed, mtdchar is a module that allows user-space making use of MTD devices
    via /dev/mtd* character devices. If users do not enable it, they simply cannot
    use MTD devices at all. They cannot read or write the flash contents. Is it a
    sane and useful setup? I believe not. And everyone just enables mtdchar.

    Having mtdchar separate is also a little bit harmful. People sometimes miss the
    fact that they need to enable an additional configuration option to have
    user-space MTD interfaces, and then they wonder why on earth the kernel does
    not allow using the flash? They spend time asking around.

    Thus, let's just get rid of this module and make it part of mtd core.

    Note, mtdchar had additional configuration option to enable OTP interfaces,
    which are present on some flashes. I removed that option as well - it saves a
    really tiny amount space.

    [dwmw2: Strictly speaking, you can mount file systems on MTD devices just
    fine without the mtdchar (or mtdblock) devices; you just can't do
    other manipulations directly on the underlying device. But still I
    agree that it makes sense to make this unconditional. And Yay! we
    get to kill off an instance of checking CONFIG_foo_MODULE, which is
    an abomination that should never happen.]

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     

15 Mar, 2013

1 commit

  • We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
    "_". But Al Viro broke this in "consolidate cond_syscall and
    SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
    do so.

    Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
    prefix it so something. So various places define helpers which are
    defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

    1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
    2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
    3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
    4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
    5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
    6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
    7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
    CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
    for pasting.

    (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

    Let's solve this properly:
    1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
    2) Make linux/export.h usable from asm.
    3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
    4) Make everyone use them.

    Signed-off-by: Rusty Russell
    Reviewed-by: James Hogan
    Tested-by: James Hogan (metag)

    Rusty Russell
     

03 Mar, 2013

1 commit

  • Pull MTD update from David Woodhouse:
    "Fairly unexciting MTD merge for 3.9:

    - misc clean-ups in the MTD command-line partitioning parser
    (cmdlinepart)
    - add flash locking support for STmicro chips serial flash chips, as
    well as for CFI command set 2 chips.
    - new driver for the ELM error correction HW module found in various
    TI chips, enable the OMAP NAND driver to use the ELM HW error
    correction
    - added number of new serial flash IDs
    - various fixes and improvements in the gpmi NAND driver
    - bcm47xx NAND driver improvements
    - make the mtdpart module actually removable"

    * tag 'for-linus-20130301' of git://git.infradead.org/linux-mtd: (45 commits)
    mtd: map: BUG() in non handled cases
    mtd: bcm47xxnflash: use pr_fmt for module prefix in messages
    mtd: davinci_nand: Use managed resources
    mtd: mtd_torturetest can cause stack overflows
    mtd: physmap_of: Convert device allocation to managed devm_kzalloc()
    mtd: at91: atmel_nand: for PMECC, add code to check the ONFI parameter ECC requirement.
    mtd: atmel_nand: make pmecc-cap, pmecc-sector-size in dts is optional.
    mtd: atmel_nand: avoid to report an error when lookup table offset is 0.
    mtd: bcm47xxsflash: adjust names of bus-specific functions
    mtd: bcm47xxpart: improve probing of nvram partition
    mtd: bcm47xxpart: add support for other erase sizes
    mtd: bcm47xxnflash: register this as normal driver
    mtd: bcm47xxnflash: fix message
    mtd: bcm47xxsflash: register this as normal driver
    mtd: bcm47xxsflash: write number of written bytes
    mtd: gpmi: add sanity check for the ECC
    mtd: gpmi: set the Golois Field bit for mx6q's BCH
    mtd: devices: elm: Removes literals in elm DT node
    mtd: gpmi: fix a dereferencing freed memory error
    mtd: fix the wrong timeo for panic_nand_wait()
    ...

    Linus Torvalds
     

04 Feb, 2013

1 commit

  • Currently cfi_cmdset_0002.c does not support PPB locking of sectors. This
    patch adds support for this locking/unlocking mechanism. It is needed on
    some platforms, since newer U-Boot versions do support this PPB locking
    and protect for example their environment sector(s) this way.

    This PPB locking/unlocking will be enabled for all devices supported by
    cfi_cmdset_0002 reporting 8 in the CFI word 0x49 (Sector Protect/Unprotect
    scheme).

    Please note that PPB locking does support sector-by-sector locking. But
    the whole chip can only be unlocked together. So unlocking one sector
    will automatically unlock all sectors of this device. Because of this
    chip limitation, the PPB unlocking function saves the current locking
    status of all sectors before unlocking the whole device. After unlocking
    the saved locking status is re-configured. This way only the addressed
    sectors will be unlocked.

    To selectively enable this advanced sector protection mechanism, the
    device-tree property "use-advanced-sector-protection" has been created.
    To enable support for this locking this property needs to be present in the
    flash DT node. E.g.:

    nor_flash@0,0 {
    compatible = "amd,s29gl256n", "cfi-flash";
    bank-width = ;
    use-advanced-sector-protection;
    ...

    Tested with Spansion S29GL512S10THI and Micron JS28F512M29EWx flash
    devices.

    Signed-off-by: Stefan Roese
    Tested-by: Holger Brunck
    Signed-off-by: Artem Bityutskiy

    Stefan Roese
     

12 Jan, 2013

1 commit


03 Dec, 2012

1 commit

  • When working on a problem with some flash chips that lock up during
    write-buffer operations, I think there may be a bug in the linux
    handling of chips using cfi_cmdset_0002.c.

    The datasheets I have found for a number of these chips all specify that
    when aborting a write-buffer command, it is not enough to use the
    standard reset. Rather a "write-to-buffer-reset command" is needed.
    This command is quite similar for all chips, the main variance seem to
    be if the final 0xF0 can go to any address or must go to addr_unlock1.

    The bug is then in the recovery handling when timing out at the end of
    do_write_buffer, where using the normal reset command is not sufficient.

    Without this change, if the write-buffer command fails then any
    following operations on the flash also fail.

    Signed-off-by: Harald Nordgard-Hansen
    Signed-off-by: Artem Bityutskiy

    Harald Nordgard-Hansen
     

29 Sep, 2012

1 commit

  • Unlocking may take up to 1.4 seconds on some Intel flashes. So
    lets use a max. of 1.5 seconds (1500ms) as timeout.

    See "Clear Block Lock-Bits Time" on page 40 in
    "3 Volt Intel StrataFlash Memory" 28F128J3,28F640J3,28F320J3 manual
    from February 2003

    This patch also fixes some other problems with this timeout:

    - Don't use HZ in timeout "calculation"!
    While testing we noticed that an unlocking timeout occured with
    HZ=1000 and didn't occur with HZ=300. This was because the
    timeout parameter was calculated differently depending on the
    HZ value. Now a fixed value of 1500ms is used.

    - The last parameter of WAIT_TIMEOUT (defined to
    inval_cache_and_wait_for_operation) has to be passed in
    micro-seconds. So multiply the ms value with 1000 and not 100
    to calculate this value.

    - Use variable name "mdelay" instead of misleading "udelay".

    Signed-off-by: Stefan Roese
    Tested-by: Stephan Gatzka
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Stefan Roese
     

17 Jul, 2012

1 commit


07 Jul, 2012

1 commit

  • The Kconfig help on "Flash cmd/query data swapping" still mentions
    LART_ENDIAN_BYTE. That option used to be relevant for setting
    CONFIG_MTD_CFI_LART_BIT_SWAP. That option and macro got both removed in
    v2.4.11-pre4. So, although LART endianness sounds intriguing, that part
    of the help text can be removed.

    And, while we're touching this choice, move the help text up one level.
    Currently it's available under the "NO" option, while it's relevant for
    all three options.

    Signed-off-by: Paul Bolle
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Paul Bolle
     

14 May, 2012

2 commits


31 Mar, 2012

1 commit

  • Pull MTD changes from David Woodhouse:
    - Artem's cleanup of the MTD API continues apace.
    - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst
    others.
    - More work on DiskOnChip G3, new driver for DiskOnChip G4.
    - Clean up debug/warning printks in JFFS2 to use pr_.

    Fix up various trivial conflicts, largely due to changes in calling
    conventions for things like dmaengine_prep_slave_sg() (new inline
    wrapper to hide new parameter, clashing with rewrite of previously last
    parameter that used to be an 'append' flag, and is now a bitmap of
    'unsigned long flags').

    (Also some header file fallout - like so many merges this merge window -
    and silly conflicts with sparse fixes)

    * tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits)
    mtd: docg3 add protection against concurrency
    mtd: docg3 refactor cascade floors structure
    mtd: docg3 increase write/erase timeout
    mtd: docg3 fix inbound calculations
    mtd: nand: gpmi: fix function annotations
    mtd: phram: fix section mismatch for phram_setup
    mtd: unify initialization of erase_info->fail_addr
    mtd: support ONFI multi lun NAND
    mtd: sm_ftl: fix typo in major number.
    mtd: add device-tree support to spear_smi
    mtd: spear_smi: Remove default partition information from driver
    mtd: Add device-tree support to fsmc_nand
    mtd: fix section mismatch for doc_probe_device
    mtd: nand/fsmc: Remove sparse warnings and errors
    mtd: nand/fsmc: Add DMA support
    mtd: nand/fsmc: Access the NAND device word by word whenever possible
    mtd: nand/fsmc: Use dev_err to report error scenario
    mtd: nand/fsmc: Use devm routines
    mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform
    mtd: fsmc_nand: add pm callbacks to support hibernation
    ...

    Linus Torvalds
     

27 Mar, 2012

11 commits

  • This patch is part of a set which fixes unnecessary flash erase and write errors
    resulting from the MTD CFI driver turning off vpp while an erase is in progress.
    This patch ensures that only those flash operations which call ENABLE_VPP() can
    then call DISABLE_VPP(). Other operations should never call DISABLE_VPP().

    Signed-off-by: Paul Parsons
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Paul Parsons
     
  • This patch is part of a set which fixes unnecessary flash erase and write errors
    resulting from the MTD CFI driver turning off vpp while an erase is in progress.
    This patch ensures that only those flash operations which call ENABLE_VPP() can
    then call DISABLE_VPP(). Other operations should never call DISABLE_VPP().

    Signed-off-by: Paul Parsons
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Paul Parsons
     
  • While debugging on SA11x0, the following message was observed:

    "Flash device refused suspend due to active operation (state 20)"

    Signed-off-by: Russell King
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Russell King
     
  • Signed-off-by: Uwe Kleine-König
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Uwe Kleine-König
     
  • In many places in drivers we verify for the zero length, but this is very
    inconsistent across drivers. This is obviously the right thing to do, though.
    This patch moves the check to the MTD API functions instead and removes a lot
    of duplication.

    Signed-off-by: Artem Bityutskiy
    Reviewed-by: Shmulik Ladkani
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • The MTD API function now zero the 'retlen' parameter before calling
    the driver's method — do not do this again in drivers. This removes
    duplicated '*retlen = 0' assignent from the following methods:

    'mtd_point()'
    'mtd_read()'
    'mtd_write()'
    'mtd_writev()'
    'mtd_panic_write()'

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • Many drivers check whether the partition is R/O and return -EROFS if yes.
    Let's stop having duplicated checks and move them to the API functions
    instead.

    And again a bit of noise - deleted few too sparse newlines, sorry.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • We already verify that offset and length are within the MTD device size
    in the MTD API functions. Let's remove the duplicated checks in drivers.
    This patch only affects the following API's:

    'mtd_erase()'
    'mtd_point()'
    'mtd_unpoint()'
    'mtd_get_unmapped_area()'
    'mtd_read()'
    'mtd_write()'
    'mtd_panic_write()'
    'mtd_lock()'
    'mtd_unlock()'
    'mtd_is_locked()'
    'mtd_block_isbad()'
    'mtd_block_markbad()'

    This patch adds a bit of noise by removing too sparse empty lines, but this is
    not too bad.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • The 'mtd_unpoint()' API function should be able to return an error code because
    it may fail if you specify incorrect offset. This patch changes this MTD API
    function and amends all the drivers correspondingly.

    Also return '-EOPNOTSUPP' from 'mtd_unpoint()' when the '->unpoint()' method is
    undefined. We do not really need this currently, but this just makes
    sense to be consistent with 'mtd_point()'.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • This patch renames all MTD functions by adding a "_" prefix:

    mtd->erase -> mtd->_erase
    mtd->read_oob -> mtd->_read_oob
    ...

    The reason is that we are re-working the MTD API and from now on it is
    an error to use MTD function pointers directly - we have a corresponding
    API call for every pointer. By adding a leading "_" we achieve the following:

    1. Make sure we convert every direct pointer users
    2. A leading "_" suggests that this interface is internal and it becomes
    less likely that people will use them directly
    3. Make sure all the out-of-tree modules stop compiling and the owners
    spot the big API change and amend them.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • This allows the mtdoops driver to work on flash chips using the
    AMD/Fujitsu compatible command set.

    As the code comments note, the locks used throughout the normal code
    paths in the driver are ignored, so that the chance of writing out the
    kernel's last messages are maximized.

    Signed-off-by: Ira W. Snyder
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Ira W. Snyder
     

24 Mar, 2012

1 commit


28 Feb, 2012

1 commit


10 Jan, 2012

2 commits


11 Sep, 2011

3 commits

  • Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic
    debugging feature is a generic kernel feature that provides more
    flexibility.

    (See Documentation/dynamic-debug-howto.txt)

    Also fix some punctuation, indentation, and capitalization that went
    along with the affected lines.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     
  • Therefor -> Therefore
    [Intern], [Internal] -> [INTERN]
    [REPLACABLE] -> [REPLACEABLE]
    syndrom, syndom -> syndrome
    ecc -> ECC
    buswith -> buswidth
    endianess -> endianness
    dont -> don't
    occures -> occurs
    independend -> independent
    wihin -> within
    erease -> erase
    blockes -> blocks
    ...

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy

    Brian Norris
     

25 May, 2011

3 commits

  • This is a trivial patch which removes unnecessary assignment of chip->state
    in put_chip(). It's duplicated.

    Signed-off-by: Tadashi Abe
    Acked-by: Joakim Tjernlund
    Signed-off-by: David Woodhouse

    Tadashi Abe
     
  • cfi erase command hangs up when erase and read contention occurs.
    If read runs at the same address as erase operation, read issues
    Erase-Suspend via get_chip() and the erase goes into sleep in wait queue.
    But in this case, read operation exits by time-out without waking it up.

    I think the other variants (0001, 0020 and lpddr) have the same problem too.
    Tested and verified the patch only on CFI-0002 flash, though.

    Signed-off-by: Tadashi Abe
    Acked-by: Joakim Tjernlund
    Signed-off-by: David Woodhouse

    Tadashi Abe
     
  • This patch adds CFI 1.5 support for the new Spansion S29GL-S device family.
    For details, see the data sheet on the Spansion web site:
    http://www.spansion.com/Support/Datasheets/S29GL_128S_01GS_00_02_e.pdf

    Signed-off-by: Gernot Hoyler
    Acked-by: Guillaume LECERF
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Gernot Hoyler
     

31 Mar, 2011

1 commit


11 Mar, 2011

2 commits