- 17 3月, 2020 9 次提交
-
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for ESMT chips, and move the ESMT definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Eon chips, and move the Eon definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Atmel chips, and move the Atmel definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Declare a spi_nor_manufacturer struct and add basic building blocks to move manufacturer specific code outside of the core. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
Expose the flash_info struct and some function prototypes that will be used by manufacturers. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
It makes the core file a bit smaller and provides better separation between the SFDP parsing and core logic. Keep the core.h and sfdp.h definitions private in drivers/mtd/spi-nor/. Both expose just the definitions that are required by the core and manufacturer drivers. None of the SPI NOR controller drivers should include them. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
Move all SPI NOR controller drivers to a controllers/ sub-directory so that we only have SPI NOR related source files under drivers/mtd/spi-nor/. Rename spi-nor.c into core.c, we are about to split this file in multiple source files (one per manufacturer, plus one for the SFDP parsing logic). Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Rename (*set_4byte)() to (*set_4byte_addr_mode)() for a better differentiation between the 4 byte address mode and opcodes. Rename macronix_set_4byte() to spi_nor_set_4byte_addr_mode(), it will be the only 4 byte address mode method exposed to the manufacturer drivers. Here's how the manufacturers enter and exit the 4 byte address mode: - eon, gidadevice, issi, macronix, xmc use EN4B/EX4B - micron-st needs WEN. st_micron_set_4byte_addr_mode() will become a private method, as they are the only ones that need WEN before the EN4B/EX4B commands. - newer spansion have a 4BAM opcode (this translates to a new, public command). Older spansion flashes use the BRWR command (legacy in core.c -> spansion_set_4byte_addr_mode()) - winbond's method is hackish and may be reason for just a flash fixup hook -> private method Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
Replace the manufacturer prefix by something describing more precisely what those functions do. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> [tudor.ambarus@microchip.com: prepend spi_nor_ to all modified methods.] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
- 27 2月, 2020 1 次提交
-
-
由 Jonathan Neuschäfer 提交于
- Don't use `tmp` for two purposes (return value, loop counter). Instead, use `i` for the loop counter, and `ret` for the return value. - Don't use tabs between type and name in variable declarations, for consistency with other functions in spi-nor.c. - Rewrite nested `if`s as `if (a && b)`. - Remove `info` variable, and use spi_nor_ids[i] directly. Signed-off-by: NJonathan Neuschäfer <j.neuschaefer@gmx.net> [tudor.ambarus@microchip.com: change i's type from int to unsigned int, reorder local variables] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 19 2月, 2020 2 次提交
-
-
由 Sergei Shtylyov 提交于
Make use of the spi-mem direct mapping API to let advanced controllers optimize read/write operations when they support direct mapping. Based on the original patch by Boris Brezillon <boris.brezillon@bootlin.com>. Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Sergei Shtylyov 提交于
spi_nor_spimem_xfer_data() being a helper function for the data reads/ writes contains 3 fragments that depend on the data direction; and I'm going to add another one to call the SPI dirmap API... I think this function should be split so that the common fragments are put into 2 functions, spi_nor_spimem_bounce() and spi_nor_spimem_exec_op() called from spi_nor_spimem_{read|write}_data(), and the data direction dependent bits moved back into those read/write functions -- that way we would be able to avoid *goto*s otherwise needed in the next patch adding the SPI dirmap support... Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 17 2月, 2020 2 次提交
-
-
由 Jungseung Lee 提交于
The shift variable of SR_BP is conclusive because the first bit of SR_BP is fixed on all known flashes. Replace ffs operation with SR_BP_SHIFT. Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Sergei Shtylyov 提交于
The driver calls le32_to_cpu() to convert the little-endian tables to a CPU endianness, where le32_to_cpus() should have been called. Was going to use that one... and then discovered a whole array converter, le32_to_cpu_array()! :-) Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 19 1月, 2020 2 次提交
-
-
由 Michael Walle 提交于
This was tested in single, dual and quad mode on a custom board with the NXP FlexSPI controller. Signed-off-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Michael Walle 提交于
Add support for the Winbond W25Q32JW-xM flashes. These have a programmable QE bit. There is also the W25Q32JW-xQ variant which shares the ID with the W25Q32DW and W25Q32FW parts. The W25Q32JW-xQ has the QE bit hard strapped to 1, thus don't support the /HOLD and /WP pins. This was tested in single, dual and quad mode on a custom board with the NXP FlexSPI controller. Also the BP bits as well as the TB bit were tested. Signed-off-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 18 1月, 2020 2 次提交
-
-
由 Michael Walle 提交于
The commit 7b678c69 ("mtd: spi-nor: Merge spansion Quad Enable methods") forgot to actually set the QE bit in some cases. Thus this breaks quad mode accesses to flashes which support readback of the status register-2. Fix it. Fixes: 7b678c69 ("mtd: spi-nor: Merge spansion Quad Enable methods") Signed-off-by: NMichael Walle <michael@walle.cc> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Vignesh Raghavendra 提交于
mtd->size is still unassigned when running spansion_post_sfdp_fixups() hook, therefore use nor->params.size to determine the size of flash device. This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated. Fixes: 92094ebc ("mtd: spi-nor: Add spansion_post_sfdp_fixups()") Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 15 1月, 2020 1 次提交
-
-
由 Michael Walle 提交于
The ops aren't used in any SPI NOR controller. Therefore, remove them altogether. Signed-off-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 11 1月, 2020 1 次提交
-
-
由 Joseph Kust 提交于
Adds support for sst26vf016b, a smaller variant of the sst26vf064b. Tested on a sama5d3 SOC using the atmel,at91rm9200-spi controller. The dual read could not be tested. SPI_NOR_QUAD_READ is not added because it requires that the IOC bit from the Configuration Register to be set to 1, which is not the case: its default value at power-up is zero and we don't set it to one in spi-nor either. Signed-off-by: NJoseph Kust <joseph.kust@rockwellcollins.com> Signed-off-by: NBrandon Maier <brandon.maier@rockwellcollins.com> [tudor.ambarus@microchip.com: Drop quad read flag, amend commit description] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 10 1月, 2020 1 次提交
-
-
由 Tudor Ambarus 提交于
Micron flashes do not support 16 bit writes on the Status Register. According to micron datasheets, when using the Write Status Register (01h) command, the chip select should be driven LOW and held LOW until the eighth bit of the last data byte has been latched in, after which it must be driven HIGH. If CS is not driven HIGH, the command is not executed, flag status register error bits are not set, and the write enable latch remains set to 1. This fixes the lock operations on micron flashes. Reported-by: NJohn Garry <john.garry@huawei.com> Fixes: 39d1e334 ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()") Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NJohn Garry <john.garry@huawei.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 24 12月, 2019 7 次提交
-
-
由 David Bauer 提交于
Add MTD support for the Macronix MX25R3235F SPI NOR chip from Macronix. The chip has 4MB of total capacity, divided into a total of 64 sectors, each 64KB sized. The chip also supports 4KB large sectors. Additionally, it supports dual and quad read modes. Functionality was verified on an HPE/Aruba AP-303 board. Signed-off-by: NDavid Bauer <mail@david-bauer.net> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Vignesh Raghavendra 提交于
Add USE_FSR flag to all variants of n25q entries that support Flag Status Register. Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Tested-by: John Garry <john.garry@huawei.com> #for n25q128a13 Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Vignesh Raghavendra 提交于
Add entries for mt25q*256a and mt25q*512a flashes. These are similar to existing n25q variants but support stateless 4 byte addressing opcodes Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Vignesh Raghavendra 提交于
mt25q family is different from n25q family of devices, even though manf ID and device IDs are same. mt25q flash has bit 6 set in 5th byte of READ ID response which can be used to distinguish it from n25q variant. mt25q flashes support stateless 4 Byte addressing opcodes where as n25q flashes don't. Therefore, have two separate entries for mt25qu512a and n25q512a. Fixes: 9607af6f ("mtd: spi-nor: Rename "n25q512a" to "mt25qu512a (n25q512a)"") Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jerome Brunet 提交于
Tested on the Amlogic aml-libretech-pc platform which does not support dual or quad modes Signed-off-by: NJerome Brunet <jbrunet@baylibre.com> [tudor.ambarus@microchip.com: order entry alphabetically] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jungseung Lee 提交于
For GD25Q256, wrong SR bit for top/bottom selection is being used. Fix it to use appropriate bit. Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 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>
-
- 23 12月, 2019 3 次提交
-
-
由 Jungseung Lee 提交于
Each vendor uses different bits for SR_TB of flash. To avoid ambiguity, rename SR_TB to indicate the bit used. Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jungseung Lee 提交于
Fix typo s/JESB216/JESD216/ Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Robert Marko 提交于
The w25q256 supports 4-byte opcodes so lets add the flag. Tested on OpenWrt under 4.19.82 kernel on 8devices Habanero. Signed-off-by: NRobert Marko <robimarko@gmail.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 12 11月, 2019 5 次提交
-
-
由 Sagar Shrikant Kadam 提交于
Set the default Quad Enable method for ISSI flashes. Used for ISSI flashes (IS25WP256D-JMLE) that do not support SFDP tables and can not determine the Quad Enable method by parsing BFPT. Based on code originally written by Wesley Terpstra <wesley@sifive.com> and/or Palmer Dabbelt <palmer@sifive.com> https://github.com/riscv/riscv-linux/commit/c94e267766d62bc9a669611c3d0c8ed5ea26569bSigned-off-by: NSagar Shrikant Kadam <sagar.kadam@sifive.com> [tudor.ambarus@microchip.com: - rebase, split and adapt for latest spi-nor/next, - use PMC CFI ID for ISSI. According to JEP106BA, "Programmable Micro Corp" changed its name to Integrated Silicon Solution (ISSI)] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Sagar Shrikant Kadam 提交于
Update the spi_nor_id table for is25wp256 (32MB) device from ISSI, present on HiFive Unleashed dev board (Rev: A00). Use the post bfpt fixup hook for the is25wp256 device, as done for the is25lp256 device to overwrite the wrong address width advertised by BFPT. Signed-off-by: NSagar Shrikant Kadam <sagar.kadam@sifive.com> [tudor.ambarus@microchip.com: rebase, split and adapt for latest spi-nor/next] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Manivannan Sadhasivam 提交于
Add MTD support for w25q256jw SPI NOR chip from Winbond. This chip supports dual/quad I/O mode with 512 blocks of memory organized in 64KB sectors. In addition to this, there is also small 4KB sectors available for flexibility. The device has been validated using Thor96 board. Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tudor Ambarus <tudor.ambarus@microchip.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: NDarshak Patel <darshak.patel@einfochips.com> [Mani: cleaned up for upstream] Signed-off-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Tudor Ambarus 提交于
When the controller is not under the SPI-MEM interface it may implement the optional controller_ops->erase() method. nor->spimem and nor->controller_ops are mutually exclusive. Move the nor->controller_ops->erase != NULL check as an 'else if' case to nor->spimem, in order to avoid the nor->controller_ops != NULL check. Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Tudor Ambarus 提交于
Expand the spi_nor_check() to make sure that nor->spimem and nor->controller_ops are mutually exclusive. Fixes: b35b9a10 ("mtd: spi-nor: Move m25p80 code in spi-nor.c") Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 11 11月, 2019 4 次提交
-
-
由 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>
-
由 Tudor Ambarus 提交于
Merge spansion_no_read_cr_quad_enable() spansion_read_cr_quad_enable() into spi_nor_sr2_bit1_quad_enable(). Reduce code duplication by introducing spi_nor_write_16bit_cr_and_check(). The Configuration Register contains bits that can be updated in future: FREEZE, CMP. Provide a generic method that allows updating all bits of the Configuration Register. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 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>
-
由 Tudor Ambarus 提交于
Test that all the bits from Status Register 1 and Status Register 2 were written correctly. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-