1. 26 11月, 2016 1 次提交
  2. 23 11月, 2016 2 次提交
  3. 14 7月, 2016 2 次提交
  4. 10 7月, 2016 1 次提交
    • B
      mtd: spi-nor: fix wrong "fully unlocked" test · 06586204
      Brian Norris 提交于
      In stm_unlock(), the test to determine whether we've fully unlocked the
      flash checks for the lock length to be equal to the flash size. That is
      a typo/think-o -- the condition actually means the flash is completely
      *locked.* We should be using the inverse condition -- that the lock
      length is 0 (i.e., no protection).
      
      The result of this bug is that we never actually turn off the Status
      Register Write Disable bit, even if the flash is completely unlocked.
      Now we can.
      
      Fixes: 47b8edbf ("mtd: spi-nor: disallow further writes to SR if WP# is low")
      Reported-by: NGiorgio <giorgio.nicole@arcor.de>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
      06586204
  5. 02 6月, 2016 5 次提交
  6. 11 5月, 2016 1 次提交
  7. 08 3月, 2016 8 次提交
  8. 05 3月, 2016 1 次提交
  9. 13 2月, 2016 2 次提交
    • C
      mtd: spi-nor: remove micron_quad_enable() · 3b5394a3
      Cyrille Pitchen 提交于
      This patch remove the micron_quad_enable() function which force the Quad
      SPI mode. However, once this mode is enabled, the Micron memory expect ALL
      commands to use the SPI 4-4-4 protocol. Hence a failure does occur when
      calling spi_nor_wait_till_ready() right after the update of the Enhanced
      Volatile Configuration Register (EVCR) in the micron_quad_enable() as
      the SPI controller driver is not aware about the protocol change.
      
      Since there is almost no performance increase using Fast Read 4-4-4
      commands instead of Fast Read 1-1-4 commands, we rather keep on using the
      Extended SPI mode than enabling the Quad SPI mode.
      
      Let's take the example of the pretty standard use of 8 dummy cycles during
      Fast Read operations on 64KB erase sectors:
      
      Fast Read 1-1-4 requires 8 cycles for the command, then 24 cycles for the
      3byte address followed by 8 dummy clock cycles and finally 65536*2 cycles
      for the read data; so 131112 clock cycles.
      
      On the other hand the Fast Read 4-4-4 would require 2 cycles for the
      command, then 6 cycles for the 3byte address followed by 8 dummy clock
      cycles and finally 65536*2 cycles for the read data. So 131088 clock
      cycles. The theorical bandwidth increase is 0.0%.
      
      Now using Fast Read operations on 512byte pages:
      Fast Read 1-1-4 needs 8+24+8+(512*2) = 1064 clock cycles whereas Fast
      Read 4-4-4 would requires 2+6+8+(512*2) = 1040 clock cycles. Hence the
      theorical bandwidth increase is 2.3%.
      Consecutive reads for non sequential pages is not a relevant use case so
      The Quad SPI mode is not worth it.
      
      mtd_speedtest seems to confirm these figures.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Fixes: 548cd3ab ("mtd: spi-nor: Add quad I/O support for Micron SPI NOR")
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      3b5394a3
    • S
      mtd: spi-nor: Add support for s25fl116k · c0826679
      Sascha Hauer 提交于
      The Spansion s25fl116k is a 16MBit NOR Flash supporting dual and
      quad read operations.
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      c0826679
  10. 07 1月, 2016 1 次提交
  11. 06 1月, 2016 2 次提交
  12. 10 12月, 2015 1 次提交
  13. 05 12月, 2015 1 次提交
  14. 02 12月, 2015 1 次提交
  15. 20 11月, 2015 2 次提交
  16. 17 11月, 2015 1 次提交
  17. 12 11月, 2015 3 次提交
  18. 20 10月, 2015 1 次提交
  19. 14 10月, 2015 4 次提交
    • B
      mtd: spi-nor: disable protection for Winbond flash at startup · c6fc2171
      Brian Norris 提交于
      In case the flash was locked at boot time.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      c6fc2171
    • B
      mtd: spi-nor: support lock/unlock/is_locked for Winbond · 357ca38d
      Brian Norris 提交于
      Many other flash share the same features as ST Micro. I've tested some
      Winbond flash, so add them.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      357ca38d
    • B
      mtd: spi-nor: add mtd_is_locked() support · 5bf0e69b
      Brian Norris 提交于
      This enables ioctl(MEMISLOCKED). Status can now be reported in the
      mtdinfo or flash_lock utilities found in mtd-utils.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      5bf0e69b
    • B
      mtd: spi-nor: refactor block protection functions · 62593cf4
      Brian Norris 提交于
      This code was a bit sloppy, would produce a lot of copy-and-paste, and
      did not always provide a sensible interface:
      
       * It didn't validate the length for LOCK and the offset for UNLOCK, so
         we were essentially discarding half of the user-supplied data and
         assuming what they wanted to lock/unlock
       * It didn't do very good error checking
       * It didn't make use of the fact that this operation works on
         power-of-two dimensions
      
      So, rewrite this to do proper bit arithmetic rather than a bunch of
      hard-coded condition tables. Now we have:
      
       * More comments on how this was derived
       * Notes on what is (and isn't) supported
       * A more exendible function, so we could add support for other
         protection ranges
       * More accurate locking - e.g., suppose the top quadrant is locked (75%
         to 100%); then in the following cases, case (a) will succeed but (b)
         will not (return -EINVAL):
           (a) user requests lock 3rd quadrant (50% to 75%)
           (b) user requests lock 3rd quadrant, minus a few blocks (e.g., 50%
               to 73%)
         Case (b) *should* fail, since we'd have to lock blocks that weren't
         requested. But the old implementation didn't know the difference and
         would lock the entire second half (50% to 100%)
      
      This refactoring work will also help enable the addition of
      mtd_is_locked() support and potentially the support of bottom boot
      protection (TB=1).
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      62593cf4