1. 03 10月, 2018 11 次提交
  2. 05 9月, 2018 1 次提交
  3. 01 8月, 2018 2 次提交
    • M
      mtd: rawnand: allocate dynamically ONFI parameters during detection · 3d3fe3c0
      Miquel Raynal 提交于
      Now that it is possible to do dynamic allocations during the
      identification phase, convert the onfi_params structure (which is only
      needed with ONFI compliant chips) into a pointer that will be allocated
      only if needed.
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      3d3fe3c0
    • B
      mtd: spi-nor: only apply reset hacks to broken hardware · bb276262
      Brian Norris 提交于
      Commit 59b356ff ("mtd: m25p80: restore the status of SPI flash when
      exiting") is the latest from a long history of attempts to add reboot
      handling to handle stateful addressing modes on SPI flash. Some prior
      mostly-related discussions:
      
      http://lists.infradead.org/pipermail/linux-mtd/2013-March/046343.html
      [PATCH 1/3] mtd: m25p80: utilize dedicated 4-byte addressing commands
      
      http://lists.infradead.org/pipermail/barebox/2014-September/020682.html
      [RFC] MTD m25p80 3-byte addressing and boot problem
      
      http://lists.infradead.org/pipermail/linux-mtd/2015-February/057683.html
      [PATCH 2/2] m25p80: if supported put chip to deep power down if not used
      
      Previously, attempts to add reboot-time software reset handling were
      rejected, but the latest attempt was not.
      
      Quick summary of the problem:
      Some systems (e.g., boot ROM or bootloader) assume that they can read
      initial boot code from their SPI flash using 3-byte addressing. If the
      flash is left in 4-byte mode after reset, these systems won't boot. The
      above patch provided a shutdown/remove hook to attempt to reset the
      addressing mode before we reboot. Notably, this patch misses out on
      huge classes of unexpected reboots (e.g., crashes, watchdog resets).
      
      Unfortunately, it is essentially impossible to solve this problem 100%:
      if your system doesn't know how to reset the SPI flash to power-on
      defaults at initialization time, no amount of software can really rescue
      you -- there will always be a chance of some unexpected reset that
      leaves your flash in an addressing mode that your boot sequence didn't
      expect.
      
      While it is not directly harmful to perform hacks like the
      aforementioned commit on all 4-byte addressing flash, a
      properly-designed system should not need the hack -- and in fact,
      providing this hack may mask the fact that a given system is indeed
      broken. So this patch attempts to apply this unsound hack more narrowly,
      providing a strong suggestion to developers and system designers that
      this is truly a hack. With luck, system designers can catch their errors
      early on in their development cycle, rather than applying this hack long
      term. But apparently enough systems are out in the wild that we still
      have to provide this hack.
      
      Document a new device tree property to denote systems that do not have a
      proper hardware (or software) reset mechanism, and apply the hack (with
      a loud warning) only in this case.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      bb276262
  4. 31 7月, 2018 5 次提交
    • M
      mtd: rawnand: allocate model parameter dynamically · 2023f1fa
      Miquel Raynal 提交于
      Thanks to the migration of all drivers to use nand_scan() and the
      related nand_controller_ops, we can now allocate data during the
      detection phase. Let's do it first for the NAND model parameter which
      is allocated in nand_detect().
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      2023f1fa
    • M
      mtd: rawnand: do not export nand_scan_[ident|tail]() anymore · 98732da1
      Miquel Raynal 提交于
      Both nand_scan_ident() and nand_scan_tail() helpers used to be called
      directly from controller drivers that needed to tweak some ECC-related
      parameters before nand_scan_tail(). This separation prevented dynamic
      allocations during the phase of NAND identification, which was
      inconvenient.
      
      All controller drivers have been moved to use nand_scan(), in
      conjunction with the chip->ecc.[attach|detach]_chip() hooks that
      actually do the required tweaking sequence between both ident/tail
      calls, allowing programmers to use dynamic allocation as they need all
      across the scanning sequence.
      
      Declare nand_scan_[ident|tail]() statically now.
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      98732da1
    • M
      mtd: rawnand: add hooks that may be called during nand_scan() · 05b54c7b
      Miquel Raynal 提交于
      In order to remove the limitation that forbids dynamic allocation in
      nand_scan_ident(), we must create a path that will be the same for all
      controller drivers. The idea is to use nand_scan() instead of the widely
      used nand_scan_ident()/nand_scan_tail() couple. In order to achieve
      this, controller drivers will need to adjust some parameters between
      these two functions depending on the NAND chip wired on them.
      
      This takes the form of two new hooks (->{attach,detach}_chip()) that are
      placed in a new nand_controller_ops structure, which is then attached
      to the nand_controller object at driver initialization time.
      ->attach_chip() is called between nand_scan_ident() and
      nand_scan_tail(), and ->detach_chip() is called in the error path of
      nand_scan() and in nand_cleanup().
      
      Note that some NAND controller drivers don't have a dedicated
      nand_controller object and instead rely on the default/dummy one
      embedded in nand_chip. If you're in this case and still want to
      initialize the controller ops, you'll have to manipulate
      chip->dummy_controller directly.
      
      Last but not least, it's worth mentioning that we plan to move some of
      the controller related hooks placed in nand_chip into
      nand_controller_ops to make the separation between NAND chip and NAND
      controller methods clearer.
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Acked-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      05b54c7b
    • M
      mtd: rawnand: better name for the controller structure · 7da45139
      Miquel Raynal 提交于
      In the raw NAND core, a NAND chip is described by a nand_chip structure,
      while a NAND controller is described with a nand_hw_control structure
      which is not very meaningful.
      
      Rename this structure nand_controller.
      
      As the structure gets renamed, it is logical to also rename the core
      function initializing it from nand_hw_control_init() to
      nand_controller_init().
      
      Lastly, the 'hwcontrol' entry of the nand_chip structure is not
      meaningful neither while it has the role of fallback when no controller
      structure is provided by the driver (the controller driver is dumb and
      can only control a single chip). Thus, it is renamed dummy_controller.
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Acked-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      7da45139
    • M
      mtd: rawnand: make subop helpers return unsigned values · 760c435e
      Miquel Raynal 提交于
      A report from Colin Ian King pointed a CoverityScan issue where error
      values on these helpers where not checked in the drivers. These
      helpers can error out only in case of a software bug in driver code,
      not because of a runtime/hardware error. Hence, let's WARN_ON() in this
      case and return 0 which is harmless anyway.
      
      Fixes: 8878b126 ("mtd: nand: add ->exec_op() implementation")
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      760c435e
  5. 20 7月, 2018 2 次提交
  6. 18 7月, 2018 12 次提交
  7. 02 7月, 2018 4 次提交
  8. 01 6月, 2018 1 次提交
  9. 15 5月, 2018 1 次提交
  10. 14 5月, 2018 1 次提交