1. 22 5月, 2014 2 次提交
  2. 21 5月, 2014 9 次提交
  3. 10 5月, 2014 1 次提交
    • B
      mtd: nand: refactor erase_cmd() to return chip status · 49c50b97
      Brian Norris 提交于
      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 14c65786 (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: NBrian Norris <computersforpeace@gmail.com>
      Tested-by: NLee Jones <lee.jones@linaro.org>
      49c50b97
  4. 30 4月, 2014 1 次提交
  5. 16 4月, 2014 5 次提交
  6. 05 4月, 2014 1 次提交
    • R
      Fix index regression in nand_read_subpage · 4a4163ca
      Ron 提交于
      Commit 7351d3a5 added an index variable
      as part of fixing checkpatch warnings, presumably as a tool to make some
      long lines shorter, however it only set that index in the case of there
      being no gaps in eccpos for the fragment being read.  Which means the
      later step of filling ecccode from oob_poi will use the wrong indexing
      into eccpos in that case.
      
      This patch restores the behaviour that existed prior to that change.
      Signed-off-by: NRon Lee <ron@debian.org>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      4a4163ca
  7. 01 4月, 2014 1 次提交
  8. 26 3月, 2014 4 次提交
  9. 20 3月, 2014 13 次提交
  10. 11 3月, 2014 3 次提交
    • H
      mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC · 90445ff6
      Herve Codina 提交于
      Crash detected on sam5d35 and its pmecc nand ecc controller.
      
      The problem was a call to chip->ecc.hwctl from nand_write_subpage_hwecc
      (nand_base.c) when we write a sub page.
      chip->ecc.hwctl function is not set when we are using PMECC controller.
      As a workaround, set NAND_NO_SUBPAGE_WRITE for PMECC controller in
      order to disable sub page access in nand_write_page.
      Signed-off-by: NHerve Codina <Herve.CODINA@celad.com>
      Acked-by: NJosh Wu <josh.wu@atmel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      90445ff6
    • H
      mtd: gpmi: add subpage read support · b8e2931d
      Huang Shijie 提交于
      1) Why add the subpage read support?
        The page size of the nand chip becomes larger and larger, the imx6 has to
        supports the 16K page or even bigger page. But sometimes, the upper layer only
        needs a small part of the page, such as 512 bytes or less.
      
        For example, ubiattach may only read 64 bytes per page.
      
      2) We only enable the subpage read support when it meets the conditions:
         <1> the chip is imx6 (or later chips) which can supports large nand page.
         <2> the size of ECC parity is byte aligned.
             If the size of ECC parity is not byte aligned, the calling of NAND_CMD_RNDOUT
             will fail.
      
      3) What does this patch do?
         This patch will fake a virtual small page for the subpage read, and call the
         gpmi_ecc_read_page() to do the real work.
      
         In order to fake a virtual small page, the patch changes the BCH registers and
         the bch_geometry{}. After the subpage read finished, we will restore them back.
      
      4) Performace:
          4.1) Tested with Toshiba TC58NVG2S0F(4096 + 224) with the following command:
               #ubiattach /dev/ubi_ctrl -m 4
      
             The detail information of /dev/mtd4 shows below:
             --------------------------------------------------------------
             #mtdinfo /dev/mtd4
              mtd4
              Name:                           test
              Type:                           nand
              Eraseblock size:                262144 bytes, 256.0 KiB
              Amount of eraseblocks:          1856 (486539264 bytes, 464.0 MiB)
              Minimum input/output unit size: 4096 bytes
              Sub-page size:                  4096 bytes
              OOB size:                       224 bytes
              Character device major/minor:   90:8
              Bad blocks are allowed:         true
              Device is writable:             true
             --------------------------------------------------------------
      
          4.2) Before this patch:
             --------------------------------------------------------------
             [   94.530495] UBI: attaching mtd4 to ubi0
             [   98.928850] UBI: scanning is finished
             [   98.953594] UBI: attached mtd4 (name "test", size 464 MiB) to ubi0
             [   98.958562] UBI: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
             [   98.964076] UBI: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
             [   98.969518] UBI: VID header offset: 4096 (aligned 4096), data offset: 8192
             [   98.975128] UBI: good PEBs: 1856, bad PEBs: 0, corrupted PEBs: 0
             [   98.979843] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
             [   98.985878] UBI: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2024916145
             [   98.993635] UBI: available PEBs: 0, total reserved PEBs: 1856, PEBs reserved for bad PEB handling: 40
             [   99.001807] UBI: background thread "ubi_bgt0d" started, PID 831
             --------------------------------------------------------------
             The attach time is about 98.9 - 94.5 = 4.4s
      
          4.3) After this patch:
             --------------------------------------------------------------
             [  286.464906] UBI: attaching mtd4 to ubi0
             [  289.186129] UBI: scanning is finished
             [  289.211416] UBI: attached mtd4 (name "test", size 464 MiB) to ubi0
             [  289.216360] UBI: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
             [  289.221858] UBI: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
             [  289.227293] UBI: VID header offset: 4096 (aligned 4096), data offset: 8192
             [  289.232878] UBI: good PEBs: 1856, bad PEBs: 0, corrupted PEBs: 0
             [  289.237628] UBI: user volume: 0, internal volumes: 1, max. volumes count: 128
             [  289.243553] UBI: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 2024916145
             [  289.251348] UBI: available PEBs: 1812, total reserved PEBs: 44, PEBs reserved for bad PEB handling: 40
             [  289.259417] UBI: background thread "ubi_bgt0d" started, PID 847
             --------------------------------------------------------------
             The attach time is about 289.18 - 286.46 = 2.7s
      
           4.4) The conclusion:
             We achieve (4.4 - 2.7) / 4.4 = 38.6% faster in the ubiattach.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      b8e2931d
    • H
      mtd: gpmi: do not use the mtd->writesize · 4a57d670
      Huang Shijie 提交于
      The nfc_geo->payload_size is equal to the mtd->writesize now,
      use the nfc_geo->payload_size to replace the mtd->writesize.
      
      This patch makes preparation for the gpmi's subpage read support.
      In the subpage support, the nfc_geo->payload_size maybe smaller then
      the mtd->writesize.
      Signed-off-by: NHuang Shijie <b32955@freescale.com>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      4a57d670