- 01 8月, 2018 1 次提交
-
-
由 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>
-
- 18 5月, 2018 3 次提交
-
-
由 YuheiOKAWA 提交于
Add support for Eon en25qh32 spi nor flash. Signed-off-by: NYuheiOKAWA <tochiro.srchack@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Kimmo Rautkoski 提交于
Added support for is25wp032, is25wp064 and is25wp128. Signed-off-by: NKimmo Rautkoski <ext-kimmo.rautkoski@vaisala.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Stephen Douthit 提交于
Datasheet: https://www.winbond.com/resource-files/w25q32jv%20dtr%20revf%2002242017.pdf Minimal testing done with fw_printenv/fw_setenv, test board did not support dual or quad access. Signed-off-by: NStephen Douthit <stephend@silicom-usa.com> Tested-by: NStephen Douthit <stephend@silicom-usa.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
- 21 4月, 2018 4 次提交
-
-
由 NeilBrown 提交于
Winbond spi-nor flash 32MB and larger have an 'Extended Address Register' as one option for addressing beyond 16MB (Macronix has the same concept, Spansion has EXTADD bits in the Bank Address Register). According to section 8.2.7 Write Extended Address Register (C5h) of the Winbond W25Q256FV data sheet (256M-BIT SPI flash) The Extended Address Register is only effective when the device is in the 3-Byte Address Mode. When the device operates in the 4-Byte Address Mode (ADS=1), any command with address input of A31-A24 will replace the Extended Address Register values. It is recommended to check and update the Extended Address Register if necessary when the device is switched from 4-Byte to 3-Byte Address Mode. So the documentation suggests clearing the EAR after switching to 3-byte mode. Experimentation shows that the EAR is *always* one after the switch to 3-byte mode, so clearing the EAR is mandatory at shutdown for a subsequent 3-byte-addressed reboot to work. Note that some SOCs (e.g. MT7621) do not assert a reset line at normal reboot, so we cannot rely on hardware reset. The MT7621 does assert a reset line at watchdog-reset. Acked-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NNeilBrown <neil@brown.name> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Hauke Mehrtens 提交于
These devices are produced by Wuhan Xinxin Semiconductor Manufacturing Corp. (XMC) and found on some routers from Chinese manufactures. The data sheets can be found here: http://www.xmcwh.com/Uploads/2018-03-01/5a9799e4cb355.pdf http://www.xmcwh.com/Uploads/2018-02-05/5a77e6dbe968b.pdfSigned-off-by: NHauke Mehrtens <hauke@hauke-m.de> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Marek Vasut 提交于
Add support for ISSI is25lp256 spi nor flash. Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Angelo Dureghello <angelo@sysam.it> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Thor Thayer 提交于
Add support for a new Micron 2Gb Flash memory part. Datasheet is available: mt25q_qlkt_l_02g_cbb_0.pdf Testing was done on a Stratix10 SoCFPGA Development Kit. Reported-by: NSujith Chidurala <sujith.chakra.chidurala@intel.com> Tested-by: NPaul Kim <paul.kim@intel.com> Signed-off-by: NThor Thayer <thor.thayer@linux.intel.com> Acked-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
- 21 3月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
MTD users are no longer checking erase_info->state to determine if the erase operation failed or succeeded. Moreover, mtd_erase_callback() is now a NOP. We can safely get rid of all mtd_erase_callback() calls and all erase_info->state assignments. While at it, get rid of the erase_info->state field, all MTD_ERASE_XXX definitions and the mtd_erase_callback() function. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Acked-by: NBert Kenward <bkenward@solarflare.com> --- Changes in v2: - Address a few coding style issues (reported by Miquel) - Remove comments that are no longer valid (reported by Miquel)
-
- 28 12月, 2017 2 次提交
-
-
由 Romain Porte 提交于
Add support for a new ISSI 1MB SPI NOR chip that was tested in our lab. Datasheet is available at: http://www.issi.com/WW/pdf/25LP-WP080D.pdf Testing was done only without the SPI_NOR_{DUAL,QUAD}_READ flags that were added later, according to the datasheet. Tested-by: NPascal Fabreges <pascal.fabreges@nokia.com> Reviewed-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: NRomain Porte <romain.porte@nokia.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Rafael Gago 提交于
They are exactly the same as the s25fl064l but bigger. Signed-off-by: NRafael Gago Castano <rgc@hms.se> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 20 12月, 2017 2 次提交
-
-
由 Sean Nyekjaer 提交于
Signed-off-by: NSean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Sean Nyekjaer 提交于
Signed-off-by: NSean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 13 12月, 2017 4 次提交
-
-
由 Hou Zhiqiang 提交于
Add this API to restore the status of SPI flash chip to the default such as addressing mode, whenever detach the driver from device or reboot the system. Signed-off-by: NHou Zhiqiang <Zhiqiang.Hou@nxp.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Aaron Sierra 提交于
Previously, the lock and unlock functions returned success even if the BP bits were not actually updated in the status register due to hardware write protection. Introduce write_sr_and_check() to write and read back the status register to ensure the desired BP bits are actually set as requested. Signed-off-by: NJoe Schultz <jschultz@xes-inc.com> Signed-off-by: NAaron Sierra <asierra@xes-inc.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Bean Huo (beanhuo) 提交于
For Micron spi nor device, when erase/program operation fails, especially the failure results from intending to modify protected space, spi-nor upper layers still get the return which shows the operation succeeds. This is because current spi_nor_fsr_ready() only uses FSR bit.7 (flag status register) to check device whether ready. This patch fixes this issue by checking relevant error bits in FSR. The FSR is a powerful tool to investigate the status of device, checking information regarding what the memory is actually doing and detecting possible error conditions. Signed-off-by: Nbeanhuo <beanhuo@micron.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Angelo Dureghello 提交于
Add support for ISSI is25lp128 spi nor flash. Signed-off-by: NAngelo Dureghello <angelo@sysam.it> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 30 10月, 2017 2 次提交
-
-
由 Philipp Puschmann 提交于
Add Everspin mr25h128 16KB MRAM to the list of supported chips. Signed-off-by: NPhilipp Puschmann <pp@emlix.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Roman Yeryomin 提交于
Signed-off-by: NRoman Yeryomin <roman@advem.lv> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 23 10月, 2017 1 次提交
-
-
由 Neil Armstrong 提交于
Add JEDEC entry for the Winbond w25q16fw/w25q16dw with similar flags and format than the Winbond w25q32dw entry. Tested on a Khadas VIM2 SBC board with an Amlogic S912 SoC. Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 11 10月, 2017 5 次提交
-
-
由 Klaus Goger 提交于
Tested against GD25LQ32D but the GD25LQ32C datasheet seems to be identically feature-wise. Therefore dropping the suffix as it's probably only indicating the die revision. Signed-off-by: NKlaus Goger <klaus.goger@theobroma-systems.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Andy Yan 提交于
Add support for GD25Q256, a 32MiB SPI Nor flash from GigaDevice. Signed-off-by: NAndy Yan <andy.yan@rock-chips.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Andy Yan 提交于
Some manufacturers may use different bit to set QE on different memories. The GD25Q256 from GigaDevice is an example, which uses S6(bit 6 of the Status Register-1) to set QE, which is different with other supported memories from GigaDevice that use S9(bit 1 of the Status Register-2). This makes it is impossible to select the quad enable method by distinguishing the MFR. This patch introduce a quad_enable function which can be set per memory in the flash_info list table. Signed-off-by: NAndy Yan <andy.yan@rock-chips.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Kamal Dasu 提交于
Implemented and populated spi-nor mtd PM handlers for resume ops. spi-nor resume op re-initializes spi-nor flash to its probed state by calling the newly implemented spi_nor_init() function. Signed-off-by: NKamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Kamal Dasu 提交于
This patch extracts some chunks from spi_nor_init_params and spi_nor_scan() and moves them into a new spi_nor_init() function. Indeed, spi_nor_init() regroups all the required SPI flash commands to be sent to the SPI flash memory before performing any runtime operations (Fast Read, Page Program, Sector Erase, ...). Hence spi_nor_init(): 1) removes the flash protection if applicable for certain vendors. 2) sets the Quad Enable bit, if needed, before using Quad SPI protocols. 3) makes the memory enter its (stateful) 4-byte address mode, if needed, for SPI flash memory > 128Mbits not supporting the 4-byte address instruction set. spi_nor_scan() now ends by calling spi_nor_init() once the probe phase has completed. Further patches could also use spi_nor_init() to implement the mtd->_resume() handler for the spi-nor framework. Signed-off-by: NKamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 10 10月, 2017 1 次提交
-
-
由 Richard Weinberger 提交于
header.minor is of type u8 and cannot be negative. Detected by CoverityScan CID#1417858 ("Integer handling issues") Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 18 9月, 2017 2 次提交
-
-
由 Cyrille Pitchen 提交于
spi_nor_read_sfdp() calls nor->read() to read the SFDP data. When the m25p80 driver is used (pretty common case), nor->read() is then implemented by the m25p80_read() function, which is likely to initialize a 'struct spi_transfer' from its buf argument before appending this structure inside the 'struct spi_message' argument of spi_sync(). Besides the SPI sub-system states that both .tx_buf and .rx_buf members of 'struct spi_transfer' must point into dma-safe memory. However, two of the three calls of spi_nor_read_sfdp() were given pointers to stack allocated memory as buf argument, hence not in a dma-safe area. Hopefully, the third and last call of spi_nor_read_sfdp() was already given a kmalloc'ed buffer argument, hence dma-safe. So this patch fixes this issue by introducing a spi_nor_read_sfdp_dma_unsafe() function which simply wraps the existing spi_nor_read_sfdp() function and uses some kmalloc'ed memory as a bounce buffer. Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
One field of the flash parameter table contains information about the flash device size. Most of the time the data extracted from this field is valid, but sometimes the BFPT section of the SFDP table is corrupted or invalid and this field is set to 0xffffffff, thus resulting in an integer overflow when setting params->size. Since NOR devices are anayway always smaller than 2^64 bytes, we can easily stop the BFPT parsing if the size reported in this table is invalid. Fixes: f384b352 ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be> Acked-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.com>
-
- 23 8月, 2017 1 次提交
-
-
由 Claudiu Beznea 提交于
Add support for Microchip sst26vf064b QSPI memory. Signed-off-by: NClaudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 02 8月, 2017 1 次提交
-
-
由 Alexander Sverdlin 提交于
S25FL{128|256|512}S datasheets say: "When P_ERR or E_ERR bits are set to one, the WIP bit will remain set to one indicating the device remains busy and unable to receive new operation commands. A Clear Status Register (CLSR) command must be received to return the device to standby mode." Current spi-nor code works until first error occurs, but write/erase errors are not just rare hardware failures, they also occur if user tries to flash write-protected areas. After such attempt no SPI command can be executed any more and even read fails. This patch adds support for P_ERR and E_ERR bits in Status Register 1 (so that operation fails immediately and not after a long timeout) and proper recovery from the error condition. Tested on Spansion S25FS128S, which is supported by S25FL129P entry. Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 18 7月, 2017 1 次提交
-
-
由 Cyrille Pitchen 提交于
This patch adds support to the JESD216 rev B standard and parses the SFDP tables to dynamically initialize the 'struct spi_nor_flash_parameter'. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@microchip.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
- 27 6月, 2017 2 次提交
-
-
由 Harry Chou 提交于
It's an 8 MiB flash with 4 KiB erase sectors. Signed-off-by: NHarry Chou <HarryYC.Chou@gmail.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Alexander Sverdlin 提交于
This chip supports stateless 4-byte opcodes, dual and quad read and uniform 4K-byte erase. Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 21 6月, 2017 3 次提交
-
-
由 Cédric Le Goater 提交于
These devices are used on OpenPOWER systems. The SPI_NOR_DUAL_READ flags is added for the Aspeed SoCs which do not support QUAD reads. Signed-off-by: NCédric Le Goater <clg@kaod.org> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Cédric Le Goater 提交于
These modules are used on the OpenPOWER Witherspoon systems to hold the POWER9 host firmware image. The SPI_NOR_DUAL_READ flags is added for the Aspeed SoCs which do not support QUAD reads. Signed-off-by: NCédric Le Goater <clg@kaod.org> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Benjamin Herrenschmidt 提交于
Similar to the other ones, different size. The "JV" suffix is in the datasheet, I haven't seen mentions of a different one. The datasheet indicates DUAL and QUAD are supported. http://www.winbond.com/resource-files/w25m512jv%20revc%2001062017.pdfSigned-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: NJoel Stanley <joel@jms.id.au> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
- 16 5月, 2017 4 次提交
-
-
由 Dan Carpenter 提交于
Before commit cff959958832 ("mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols") then we treated 1 as -EINVAL in the caller but after that commit we changed to propagate the return. My static checker complains that it's eventually passed to an ERR_PTR() and later dereferenced, but I'm not totally certain if that's true. Regardless, returning 1 is wrong. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Cyrille Pitchen 提交于
This patch starts adding support to Octo SPI protocols (SPI x-y-8). Op codes for Fast Read and/or Page Program operations using Octo SPI protocols are not known yet (no JEDEC specification has defined them yet) but we'd rather introduce the Octo SPI protocols now so it's done as it should be. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
由 Cyrille Pitchen 提交于
This patch introduces support to Double Transfer Rate (DTR) SPI protocols. DTR is used only for Fast Read operations. According to manufacturer datasheets, whatever the number of I/O lines used during instruction (x) and address/mode/dummy (y) clock cycles, DTR is used only during data (z) clock cycles of SPI x-y-z protocols. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
由 Cyrille Pitchen 提交于
This patch changes the prototype of spi_nor_scan(): its 3rd parameter is replaced by a 'struct spi_nor_hwcaps' pointer, which tells the spi-nor framework about the actual hardware capabilities supported by the SPI controller and its driver. Besides, this patch also introduces a new 'struct spi_nor_flash_parameter' telling the spi-nor framework about the hardware capabilities supported by the SPI flash memory and the associated settings required to use those hardware caps. Then, to improve the readability of spi_nor_scan(), the discovery of the memory settings and the memory initialization are now split into two dedicated functions. 1 - spi_nor_init_params() The spi_nor_init_params() function is responsible for initializing the 'struct spi_nor_flash_parameter'. Currently this structure is filled with legacy values but further patches will allow to override some parameter values dynamically, for instance by reading the JESD216 Serial Flash Discoverable Parameter (SFDP) tables from the SPI memory. The spi_nor_init_params() function only deals with the hardware capabilities of the SPI flash memory: especially it doesn't care about the hardware capabilities supported by the SPI controller. 2 - spi_nor_setup() The second function is called once the 'struct spi_nor_flash_parameter' has been initialized by spi_nor_init_params(). With both 'struct spi_nor_flash_parameter' and 'struct spi_nor_hwcaps', the new argument of spi_nor_scan(), spi_nor_setup() computes the best match between hardware caps supported by both the (Q)SPI memory and controller hence selecting the relevant settings for (Fast) Read and Page Program operations. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-