1. 11 5月, 2020 4 次提交
  2. 25 3月, 2020 1 次提交
  3. 24 3月, 2020 1 次提交
  4. 17 3月, 2020 4 次提交
  5. 12 3月, 2020 1 次提交
  6. 11 3月, 2020 3 次提交
  7. 09 3月, 2020 1 次提交
    • C
      mtd: spinand: rework detect procedure for different READ_ID operation · f1541773
      Chuanhong Guo 提交于
      Currently there are 3 different variants of read_id implementation:
      1. opcode only. Found in GD5FxGQ4xF.
      2. opcode + 1 addr byte. Found in GD5GxGQ4xA/E
      3. opcode + 1 dummy byte. Found in other currently supported chips.
      
      Original implementation was for variant 1 and let detect function
      of chips with variant 2 and 3 to ignore the first byte. This isn't
      robust:
      
      1. For chips of variant 2, if SPI master doesn't keep MOSI low
      during read, chip will get a random id offset, and the entire id
      buffer will shift by that offset, causing detect failure.
      
      2. For chips of variant 1, if it happens to get a devid that equals
      to manufacture id of variant 2 or 3 chips, it'll get incorrectly
      detected.
      
      This patch reworks detect procedure to address problems above. New
      logic do detection for all variants separatedly, in 1-2-3 order.
      Since all current detect methods do exactly the same id matching
      procedure, unify them into core.c and remove detect method from
      manufacture_ops.
      
      Tested on GD5F1GQ4UAYIG and W25N01GVZEIG.
      Signed-off-by: NChuanhong Guo <gch981213@gmail.com>
      Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
      Link: https://lore.kernel.org/linux-mtd/20200208074439.146296-1-gch981213@gmail.com
      f1541773
  8. 19 2月, 2020 1 次提交
  9. 17 2月, 2020 1 次提交
  10. 15 1月, 2020 1 次提交
  11. 10 1月, 2020 1 次提交
  12. 24 12月, 2019 1 次提交
    • J
      mtd: spi-nor: Support TB selection using SR bit 6 · adf1092f
      Jungseung Lee 提交于
      There are some flashes to use bit 6 of status register for Top/Bottom (TB).
      Use top/bottom bit variable instead of fixed value and support this case.
      
      Set the Top/Bottom (TB) mask based on SPI_NOR_TB_SR_BIT6 flash_info flag.
      We can't use a bigger granularity, for example to set TB_BIT6 per
      manufacturer using a SNOR_F flag. The manufacturers don't have a common
      rule in regards to the TB bit:
      
      Winbond : Use the 6th bit from 32MB capacity
      W25Q20EW, W25Q50BW, W25Q128V - TB(5)
      W25Q256JV, W25M512JV - TB(6)
      
      GigaDevice : Use the 6th bit from 32MB capacity
      GD25Q16C, GD25Q32C, GD25LQ32D, GD25Q64C, GD25Q128 - TB(5)
      GD25Q256 - TB(6)
      
      Micron/STM : Keep to use 5th bit
      M25PX64, N25Q128A, N25Q512A, MT25QL512ABB, MT25QL02GCBB - TB(5)
      
      Spansion : Use the 6th bit from 16MB capacity
      S25FL116K, S25FL132K, S25FL165K - TB(5)
      S25FL128L, S25FL256L - TB(6)
      
      We can't make a correlation between TB and BP3 either, i.e. assume that if
      BP3 is defined then TB will be at BIT(6). Micron breaks this rule.
      Signed-off-by: NJungseung Lee <js07.lee@samsung.com>
      [tudor.ambarus@microchip.com: describe the reason for setting a
      new flash_info flag.]
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      adf1092f
  13. 23 12月, 2019 1 次提交
  14. 12 11月, 2019 1 次提交
  15. 11 11月, 2019 4 次提交
    • T
      mtd: spi-nor: Rename Quad Enable methods · 658488ed
      Tudor Ambarus 提交于
      Rename macronix_quad_enable() to a generic name:
      spi_nor_sr1_bit6_quad_enable().
      
      Prepend "spi_nor_" to "sr2_bit7_quad_enable". All SPI NOR generic
      methods should be prepended by "spi_nor_".
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
      658488ed
    • T
      mtd: spi-nor: Rename CR_QUAD_EN_SPAN to SR2_QUAD_EN_BIT1 · bb2dc7f4
      Tudor Ambarus 提交于
      JEDEC Basic Flash Parameter Table, 15th DWORD, bits 22:20,
      refers to this bit as "bit 1 of the status register 2".
      Rename the macro accordingly.
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
      bb2dc7f4
    • T
      mtd: spi-nor: Rework the disabling of block write protection · 3e0930f1
      Tudor Ambarus 提交于
      spi_nor_unlock() unlocks blocks of memory or the entire flash memory
      array, if requested. clear_sr_bp() unlocks the entire flash memory
      array at boot time. This calls for some unification, clear_sr_bp() is
      just an optimization for the case when the unlock request covers the
      entire flash size.
      
      Get rid of clear_sr_bp() and introduce spi_nor_unlock_all(), which is
      just a call to spi_nor_unlock() for the entire flash memory array.
      This fixes a bug that was present in spi_nor_spansion_clear_sr_bp().
      When the QE bit was zero, we used the Write Status (01h) command with
      one data byte, which might cleared the Status Register 2. We now always
      use the Write Status (01h) command with two data bytes when
      SNOR_F_HAS_16BIT_SR is set, to avoid clearing the Status Register 2.
      
      The SNOR_F_NO_READ_CR case is treated as well. When the flash doesn't
      support the CR Read command, we make an assumption about the value of
      the QE bit. In spi_nor_init(), call spi_nor_quad_enable() first, then
      spi_nor_unlock_all(), so that at the spi_nor_unlock_all() time we can
      be sure the QE bit has value one, because of the previous call to
      spi_nor_quad_enable().
      
      Get rid of the MFR handling and implement specific manufacturer
      default_init() fixup hooks.
      
      Note that this changes a bit the logic for the SNOR_MFR_ATMEL,
      SNOR_MFR_INTEL and SNOR_MFR_SST cases. Before this patch, the Atmel,
      Intel and SST chips did not set the locking ops, but unlocked the entire
      flash at boot time, while now they are setting the locking ops to
      stm_locking_ops. This should work, since the disable of the block
      protection at the boot time used the same Status Register bits to unlock
      the flash, as in the stm_locking_ops case.
      Suggested-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
      3e0930f1
    • T
      mtd: spi-nor: Fix clearing of QE bit on lock()/unlock() · 39d1e334
      Tudor Ambarus 提交于
      Make sure that when doing a lock() or an unlock() operation we don't clear
      the QE bit from Status Register 2.
      
      JESD216 revB or later offers information about the *default* Status
      Register commands to use (see BFPT DWORDS[15], bits 22:20). In this
      standard, Status Register 1 refers to the first data byte transferred on a
      Read Status (05h) or Write Status (01h) command. Status register 2 refers
      to the byte read using instruction 35h. Status register 2 is the second
      byte transferred in a Write Status (01h) command.
      
      Industry naming and definitions of these Status Registers may differ.
      The definitions are described in JESD216B, BFPT DWORDS[15], bits 22:20.
      There are cases in which writing only one byte to the Status Register 1
      has the side-effect of clearing Status Register 2 and implicitly the Quad
      Enable bit. This side-effect is hit just by the
      BFPT_DWORD15_QER_SR2_BIT1_BUGGY and BFPT_DWORD15_QER_SR2_BIT1 cases.
      Suggested-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
      Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
      39d1e334
  16. 23 10月, 2019 1 次提交
  17. 06 9月, 2019 2 次提交
  18. 29 8月, 2019 1 次提交
  19. 28 8月, 2019 8 次提交
  20. 26 8月, 2019 2 次提交