- 28 8月, 2019 4 次提交
-
-
由 Tudor Ambarus 提交于
All flash parameters and settings should reside inside 'struct spi_nor_flash_parameter'. Move the SMPT parsed erase map from 'struct spi_nor' to 'struct spi_nor_flash_parameter'. Please note that there is a roll-back mechanism for the flash parameter and settings, for cases when SFDP parser fails. The SFDP parser receives a Stack allocated copy of nor->params, called sfdp_params, and uses it to retrieve the serial flash discoverable parameters. JESD216 SFDP is a standard and has a higher priority than the default initialized flash parameters, so will overwrite the sfdp_params data when needed. All SFDP code uses the local copy of nor->params, that will overwrite it in the end, if the parser succeds. Saving and restoring the nor->params.erase_map is no longer needed, since the SFDP code does not touch it. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
All flash parameters and settings should reside inside 'struct spi_nor_flash_parameter'. Drop the local copy of quad_enable() and use the one from 'struct spi_nor_flash_parameter'. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
The Flash parameters and settings are now stored in 'struct spi_nor'. Use this instead of the stack allocated params. Few functions stop passing pointer to params, as they can get it from 'struct spi_nor'. spi_nor_parse_sfdp() and children will keep passing pointer to params because of the roll-back mechanism: in case the parsing of SFDP fails, the legacy flash parameter and settings will be restored. Zeroing params is no longer needed because all SPI NOR users kzalloc 'struct spi_nor'. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
The scope is to move all [FLASH-SPECIFIC] parameters and settings from 'struct spi_nor' to 'struct spi_nor_flash_parameter'. 'struct spi_nor_flash_parameter' describes the hardware capabilities and associated settings of the SPI NOR flash memory. It includes legacy flash parameters and settings that can be overwritten by the spi_nor_fixups hooks, or dynamically when parsing the JESD216 Serial Flash Discoverable Parameters (SFDP) tables. All SFDP params and settings will fit inside 'struct spi_nor_flash_parameter'. Move spi_nor_hwcaps related code to avoid forward declarations. Add a forward declaration that we can't avoid: 'struct spi_nor' will be used in 'struct spi_nor_flash_parameter'. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
- 21 8月, 2019 2 次提交
-
-
由 Wenwen Wang 提交于
In spi_nor_parse_4bait(), 'dwords' is allocated through kmalloc(). However, it is not deallocated in the following execution if spi_nor_read_sfdp() fails, leading to a memory leak. To fix this issue, free 'dwords' before returning the error. Fixes: 816873ea ("mtd: spi-nor: parse SFDP 4-byte Address Instruction Table") Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Dan Carpenter 提交于
The problem is that if "ret" is negative then when we check if "ret > len", that condition is going to be true because of type promotion. So this patch re-orders the code to check for negatives first and preserve those error codes. Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 20 8月, 2019 3 次提交
-
-
由 Jungseung Lee 提交于
Currently, the Top/Bottom protection function (SPI_NOR_HAS_TB) is implemented to fit some flashes with TB bit on SR. s25fl512s has TBPROT bit on CR1, so the TB protection is not working on it. Fix the wrong flag on s25fl512s. Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Eugeniy Paltsev 提交于
This commit adds support for the SST sst26wf016b flash memory IC. This IC was tested with "snps,dw-apb-ssi" SPI controller. We don't test dual/quad reads however sst26wf016b flash's datasheet advertises both dual and quad reads (and support of corresponding commands) Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Avi Fishman 提交于
Similar to w25q256 (besides not supporting QPI mode) but with different ID. The "JVM" suffix is in the datasheet. The datasheet indicates DUAL and QUAD are supported. https://www.winbond.com/resource-files/w25q256jv%20spi%20revi%2010232018%20plus.pdfSigned-off-by: NAvi Fishman <avifishman70@gmail.com> Reviewed-by: NJoel Stanley <joel@jms.id.au> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 13 8月, 2019 1 次提交
-
-
由 Tudor Ambarus 提交于
spi_nor_spansion_clear_sr_bp() depends on spansion_quad_enable(). While spansion_quad_enable() is selected as default when initializing the flash parameters, the nor->quad_enable() method can be overwritten later on when parsing BFPT. Select the write protection disable mechanism at spi_nor_init() time, when the nor->quad_enable() method is already known. Fixes: 191f5c2e ("mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes") Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 12 8月, 2019 3 次提交
-
-
由 Boris Brezillon 提交于
The spi-mem layer provides a spi_mem_supports_op() function to check whether a specific operation is supported by the controller or not. This is much more accurate than the hwcaps selection logic based on SPI_{RX,TX}_ flags. Rework the hwcaps selection logic to use spi_mem_supports_op() when nor->spimem != NULL. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
The m25p80 driver is actually a generic wrapper around the spi-mem layer. Not only the driver name is misleading, but we'd expect such a common logic to be directly available in the core. Another reason for moving this code is that SPI NOR controller drivers should progressively be replaced by SPI controller drivers implementing the spi_mem_ops interface, and when the conversion is done, we should have a single spi-nor driver directly interfacing with the spi-mem layer. While moving the code we also fix a longstanding issue when non-DMA-able buffers are passed by the MTD layer. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Vignesh Raghavendra 提交于
spi-mem layer expects all buffers passed to it to be DMA'able. But spi-nor layer mostly allocates buffers on stack for reading/writing to registers and therefore are not DMA'able. Introduce bounce buffer to be used to read/write to registers. This ensures that buffer passed to spi-mem layer during register read/writes is DMA'able. With this change nor->cmd-buf is no longer used, so drop it. Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 27 6月, 2019 1 次提交
-
-
由 Liu Xiang 提交于
mtd: spi-nor: fix nor->addr_width when its value configured from SFDP does not match the actual width IS25LP256 gets BFPT_DWORD1_ADDRESS_BYTES_3_ONLY from BFPT table for address width. But in actual fact the flash can support 4-byte address. Use a post bfpt fixup hook to overwrite the address width advertised by the BFPT. Signed-off-by: NLiu Xiang <liu.xiang6@zte.com.cn> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 24 6月, 2019 1 次提交
-
-
由 Tudor Ambarus 提交于
SPI memory devices from different manufacturers have widely different configurations for Status, Control and Configuration registers. JEDEC 216C defines a new map for these common register bits and their functions, and describes how the individual bits may be accessed for a specific device. For the JEDEC 216B compliant flashes, we can partially deduce Status and Configuration registers functions by inspecting the 16th DWORD of BFPT. Older flashes that don't declare the SFDP tables (SPANSION FL512SAIFG1 311QQ063 A ©11 SPANSION) let the software decide how to interact with these registers. The commit dcb4b22e ("spi-nor: s25fl512s supports region locking") uncovered a probe error for s25fl512s, when the Quad Enable bit CR[1] was set to one in the bootloader. When this bit is one, only the Write Status (01h) command with two data byts may be used, the 01h command with one data byte is not recognized and hence the error when trying to clear the block protection bits. Fix the above by using the Write Status (01h) command with two data bytes when the Quad Enable bit is one. Backward compatibility should be fine. The newly introduced spi_nor_spansion_clear_sr_bp() is tightly coupled with the spansion_quad_enable() function. Both assume that the Write Register with 16 bits, together with the Read Configuration Register (35h) instructions are supported. Fixes: dcb4b22e ("spi-nor: s25fl512s supports region locking") Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NJonas Bonn <jonas@norrbonn.se> Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com> Tested-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 22 6月, 2019 2 次提交
-
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Robert Marko 提交于
Testing done on Mikrotik Routerboard RB450Gx4 board under 4.14.119 and 4.19.43 kernels. The test board does not support Dual or Quad modes. Datasheet at: https://www.winbond.com/resource-files/w25q16jv%20spi%20revg%2003222018%20plus.pdfSigned-off-by: NRobert Marko <robimarko@gmail.com> [tudor.ambarus@microchip.com: w25q16jv-im/jm and w25q16jv-iq/jq have different jedec ids, fix flash name.] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 07 6月, 2019 2 次提交
-
-
由 Flavio Suligoi 提交于
In case of SPI error during the reading of the nor Id, the probe fails without any error message related to the JEDEC Id reading procedure. Signed-off-by: NFlavio Suligoi <f.suligoi@asem.it> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Andrey Smirnov 提交于
Add an entry for Micron MT25QL02 which is a 3V variant of already supported MT25QU02. Testing was done on a ZII VF610 Dev Board (rev. B). Signed-off-by: NCory Tusar <cory.tusar@pid1solutions.com> Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tudor Ambarus <tudor.ambarus@microchip.com> Cc: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org [tudor.ambarus@microchip.com: order entry alphabetically, wrap to 80 chars limit] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 01 4月, 2019 1 次提交
-
-
由 Jonas Bonn 提交于
Both the BP[0-2] bits and the TBPROT bit are supported on this chip. Tested and verified on a Cypress s25fl512s. Signed-off-by: NJonas Bonn <jonas@norrbonn.se> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 22 3月, 2019 2 次提交
-
-
由 Alexander Sverdlin 提交于
Erase types are sorted *smallest* type first, refer to spi_nor_sort_erase_mask(). Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Geert Uytterhoeven 提交于
If identification of an SPI NOR FLASH fails, the JEDEC ID is printed, which is stored in the first 3 bytes of the ID read from the FLASH. However, the extended JEDEC ID, which is stored in the remaining bytes, also matters, as it is used for identification of some FLASH types. Print all (currently 6) ID bytes read to ease failure analysis and debugging. Suggested-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 21 2月, 2019 3 次提交
-
-
由 Roger Pueyo Centelles 提交于
The Eon EN25QH64 is a 64 Mbit SPI NOR flash memory chip found on recent wireless routers. Its 32, 128 and 256 Mbit siblings are already supported. Tested on a COMFAST CF-E120A v3 router board. Signed-off-by: NRoger Pueyo Centelles <roger.pueyo@guifi.net> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Frieder Schrempf 提交于
This adds support for the Macronix MX25V8035F, a 8Mb SPI NOR chip. It is used on i.MX6UL/ULL SoMs by Kontron Electronics GmbH (N631x). It was only tested with a single data line connected, by writing and reading random data with dd. Signed-off-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Frieder Schrempf 提交于
This adds support for the EON EN25Q80A, a 8Mb SPI NOR chip. It is used on i.MX6 boards by Kontron Electronics GmbH (N60xx, N61xx). It was only tested with a single data line connected, by writing and reading random data with dd. Signed-off-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 13 2月, 2019 1 次提交
-
-
由 Ahmet Celenk 提交于
Due to two different versions (S25FL128SAGBHI200 and S25FL128SAGBHI210) of the s25fl128s qspi memory, the single "s25fl128s" device entry must be split into two to match the correct JEDEC ID's for each version. Solves paging related issues of S25FL128SAGBHI210 chips. Signed-off-by: NAhmet Celenk <ahmet.celenk@procenne.com> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Marek Vasut <marek.vasut@gmail.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 10 2月, 2019 1 次提交
-
-
由 André Valentin 提交于
The mx25u3235f is found on the ZyXEL NBG6817 router, therefore add driver support for it so that we can upstream board support. Minimal tested with u-boot tools fw_printenv/fw_setenv on GlobalScale ESPRESSObin v5 board. Signed-off-by: NAndré Valentin <avalentin@marcant.net> [miyatsu@qq.com: Remove unnecessary white space.] Signed-off-by: NDing Tao <miyatsu@qq.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
- 23 1月, 2019 2 次提交
-
-
由 Sergei Shtylyov 提交于
Spansion S25FL512S ID is erroneously using 5-byte JEDEC ID, while the chip family ID is stored in the 6th byte. Due to using only 5-byte ID, it's also covering S25FS512S and now that we have added 6-byte ID for that chip, we can convert S25FL512S to using a proper 6-byte ID as well... Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
-
由 Sergei Shtylyov 提交于
Spansion S25FS512S flash is currently misdetected as S25FL512S since the latter uses 5-byte JEDEC ID, while the 6th ID byte (family ID) is different on those chips. Add the 6-byte S25FS512S ID before S25FL512S ID in order not to break the existing S25FS512S users. Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
-
- 17 1月, 2019 2 次提交
-
-
由 Yogesh Narayan Gaur 提交于
Add octal read flag for flash mt35xu512aba. This flash, mt35xu512aba, is only complaint to SFDP JESD216B and does not seem to support newer JESD216C standard that provides auto detection of Octal mode capabilities and opcodes. Therefore, this capability is manually added using new SPI_NOR_OCTAL_READ flag. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NYogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
-
由 Yogesh Narayan Gaur 提交于
- Add opcodes for octal I/O commands * Read : 1-1-8 and 1-8-8 protocol * Write : 1-1-8 and 1-8-8 protocol * opcodes for 4-byte address mode command - Entry of macros in _convert_3to4_xxx function - Add flag SPI_NOR_OCTAL_READ specifying flash support octal read commands. This flag is required for flashes which didn't provides support for auto detection of Octal mode capabilities i.e. not seems to support newer JESD216C standard. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NYogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
-
- 11 12月, 2018 9 次提交
-
-
由 Fabrizio Castro 提交于
The is25lp016d is found on the iwg23s from iWave, therefore add driver support for it so that we can upstream board support. Signed-off-by: NFabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Cyrille Pitchen 提交于
Add support for SFDP (JESD216B) 4-byte Address Instruction Table. This table is optional but when available, we parse it to get the 4-byte address op codes supported by the memory. Using these op codes is stateless as opposed to entering the 4-byte address mode or setting the Base Address Register (BAR). Flashes that have the 4BAIT table declared can now support SPINOR_OP_PP_1_1_4_4B and SPINOR_OP_PP_1_4_4_4B opcodes. Tested on MX25L25673G. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@microchip.com> [tudor.ambarus@microchip.com: - rework erase and page program logic, - pass DMA-able buffer to spi_nor_read_sfdp(), - introduce SPI_NOR_HAS_4BAIT - various minor updates.] Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Liu Xiang 提交于
The is25lp256 supports 4-byte opcodes and quad output. Suggested-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NLiu Xiang <liu.xiang6@zte.com.cn> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Boris Brezillon 提交于
Add SPDX tags to replace the license boiler-plate and fix the MODULE_LICENSE() definition in spi-nor.c to match the license text (GPL v2). Interestingly, spi-nor.h and spi-nor.c do not use the same license (GPL v2+ for spi-nor.h, GPL v2 for spi-nor.c). Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
No need to use an integer when the value is either true or false. Make it a boolean. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Some functions called from spi_nor_scan() need a flash_info object. Let's assign nor->info early on to avoid passing info as an extra argument to each of these sub-functions. We also stop passing a flash_info object to set_4byte() and use nor->info directly. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Reorganize the code to kill forward declarations of spi_nor_match_id() macronix_quad_enable() and spi_nor_hwcaps_read2cmd(). Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
gcc should be smart enough to decide when inlining a function makes sense. Drop all inline specifiers. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
MX25L25635F and MX25L25635E share the same JEDEC-ID, but the F variant supports 4-byte opcodes while the E variant doesn't. We need a way to differentiate those 2 chips and set the SNOR_F_4B_OPCODES flag only for the F variant. Luckily, 4-byte opcode support is not the only difference: Fast Read 4-4-4 is only supported by the F variant, and this feature is advertised in the BFPT table. Use this to decide when to set the SNOR_F_4B_OPCODES flag. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-