1. 10 5月, 2018 1 次提交
  2. 04 5月, 2018 2 次提交
    • M
      mtd: rawnand: marvell: fix command xtype in BCH write hook · a2ee41fd
      Miquel Raynal 提交于
      One layout supported by the Marvell NAND controller supports NAND pages
      of 2048 bytes, all handled in one single chunk when using BCH with a
      strength of 4-bit per 512 bytes. In this case, instead of the generic
      XTYPE_WRITE_DISPATCH/XTYPE_LAST_NAKED_RW couple, the controller expects
      to receive XTYPE_MONOLITHIC_RW.
      
      This fixes problems at boot like:
      
      [    1.315475] Scanning device for bad blocks
      [    3.203108] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    3.209564] nand_bbt: error while writing BBT block -110
      [    4.243106] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    5.283106] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    5.289562] nand_bbt: error -110 while marking block 2047 bad
      [    6.323106] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    6.329559] nand_bbt: error while writing BBT block -110
      [    7.363106] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    8.403105] marvell-nfc f10d0000.flash: Timeout waiting for RB signal
      [    8.409559] nand_bbt: error -110 while marking block 2046 bad
      ...
      
      Fixes: 02f26ecf ("mtd: nand: add reworked Marvell NAND controller driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Tested-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      a2ee41fd
    • C
      mtd: rawnand: marvell: pass ms delay to wait_op · b76401fc
      Chris Packham 提交于
      marvell_nfc_wait_op() expects the delay to be expressed in milliseconds
      but nand_sdr_timings uses picoseconds. Use PSEC_TO_MSEC when passing
      tPROG_max to marvell_nfc_wait_op().
      
      Fixes: 02f26ecf ("mtd: nand: add reworked Marvell NAND controller driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
      Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      b76401fc
  3. 02 5月, 2018 1 次提交
  4. 27 4月, 2018 1 次提交
    • M
      mtd: rawnand: marvell: fix the chip-select DT parsing logic · f6997bec
      Miquel Raynal 提交于
      The block responsible of parsing the DT for the number of chip-select
      lines uses an 'if/else if/else if' block. The content of the second and
      third 'else if' conditions are:
              1/ the actual condition to enter the sub-block and
              2/ the operation to do in this sub-block.
      
              [...]
              else if (condition1_to_enter && action1() == failed)
                      raise_error();
              else if (condition2_to_enter && action2() == failed)
                      raise_error();
              [...]
      
      In case of failure, the sub-block is entered and an error raised.
      Otherwise, in case of success, the code would continue erroneously in
      the next 'else if' statement because it did not failed (and did not
      enter the first 'else if' sub-block).
      
      The first 'else if' refers to legacy bindings while the second 'else if'
      refers to new bindings. The second 'else if', which is entered
      erroneously, checks for the 'reg' property, which, for old bindings,
      does not mean anything because it would not be the number of CS
      available, but the regular register map of almost any DT node. This
      being said, the content of the 'reg' property being the register map
      offset and length, it has '2' values, so the number of CS in this
      situation is assumed to be '2'.
      
      When running nand_scan_ident() with 2 CS, the core will check for an
      array of chips. It will first issue a RESET and then a READ_ID. Of
      course this will trigger two timeouts because there is no chip in front
      of the second CS:
      
      [    1.367460] marvell-nfc f2720000.nand: Timeout on CMDD (NDSR: 0x00000080)
      [    1.474292] marvell-nfc f2720000.nand: Timeout on CMDD (NDSR: 0x00000280)
      
      Indeed, this is harmless and the core will then assume there is only one
      valid CS.
      
      Fix the logic in the whole block by entering each sub-block just on the
      'is legacy' condition, doing the action inside the sub-block. This way,
      when the action succeeds, the whole block is left.
      
      Furthermore, for both the old bindings and the new bindings the same
      logic was applied to retrieve the number of CS lines:
      using of_get_property() to get a size in bytes, converted in the actual
      number of lines by dividing it per sizeof(u32) (4 bytes).
      
      This is fine for the 'reg' property which is a list of the CS IDs but
      not for the 'num-cs' property which is directly the value of the number
      of CS.
      
      Anyway, no existing DT uses another value than 'num-cs = <1>' and no
      other value has ever been supported by the old driver (pxa3xx_nand.c).
      Remove this condition and apply a number of 1 CS anyway, as already
      described in the bindings.
      
      Finally, the 'reg' property of a 'nand' node (with the new bindings)
      gives the IDs of each CS line in use. marvell_nand.c driver first look
      at the number of CS lines that are present in this property.
      
      Better use of_property_count_elems_of_size() than dividing by 4 the size
      of the number of bytes returned by of_get_property().
      
      Fixes: 02f26ecf ("mtd: nand: add reworked Marvell NAND controller driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Tested-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      f6997bec
  5. 23 4月, 2018 1 次提交
    • B
      mtd: nand: Fix nanddev_mtd_erase() · 23566c37
      Boris Brezillon 提交于
      Commit e7bfb3fd ("mtd: Stop updating erase_info->state and calling
      mtd_erase_callback()") removed the einfo->state field and the
      MTD_ERASE_XXX macros. At the same time, the generic NAND layer was added
      and made sure to update the erase info state.
      
      It did not result in a build failure after merging the nand/for-4.17
      branch in mtd/next because the generic NAND layer is not selected yet.
      Let's fix that before a config option starts selecting MTD_NAND_CORE.
      
      Fixes: e7bfb3fd ("mtd: Stop updating erase_info->state and calling mtd_erase_callback()")
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      23566c37
  6. 21 4月, 2018 1 次提交
  7. 30 3月, 2018 2 次提交
  8. 29 3月, 2018 12 次提交
  9. 21 3月, 2018 4 次提交
  10. 20 3月, 2018 15 次提交