summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi
AgeCommit message (Collapse)Author
2025-05-06mtd: spi-nor: Send write disable cmd after every write enableVenkatesh Yadav Abbarapu
Write enable(06h) command will be sent to a flash device to set the write enable latch bit before every program, erase, write command. After that write disable command (04h) needs to be sent to clear the write enable latch. This write_disable() is missing at the majority of the places in the driver, add it to clear write enable latch. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://gist.github.com/PrasanthBabuMantena/c12f39744de188a9d08cd5ca51dc2a7b Tested-by: Prasanth Babu Mantena <p-mantena@ti.com>
2025-05-06mtd: spi-nor-core: Fixup SNOR_F_IO_MODE_EN_VOLATILE for MT35XVaishnav Achath
MT35XU512ABA has only BFPT and 4-Byte Address Instruction Table in SFDP. commit bebdc237507c ("mtd: spi-nor: Parse SFDP SCCR Map") added checks in spi_nor_octal_dtr_enable() to bail out if the 22nd DWORD in SCCR does not indicate DTR Octal Mode Enable, since MT35XU512ABA device supports octal DTR mode, add this property in SFDP fixup. Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com> Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com> Reviewed-by: Udit Kumar <u-kumar1@ti.com>
2025-04-29Revert "mtd: spi-nor: Remove recently added SST special case"Prasad Kummari
SST(sst26wf016) flashes have multiple erase block sizes, including 8 KB, 32 KB, and 64 KB. Since a 64 KB sector erase cannot be performed on all blocks, the 4 KB sector erase command should be used instead. Enabling the SPI_FLASH_USE_4K_SECTORS configuration allows the use of 4 KB sector erases, but it may increase the erase operation time for large memory flashes. This reverts commit 34cd4a72fb2d113e2754c0d643618a8e3fa549ab MEMORY ORGANIZATION: The SST26WF016B/016BA SQI memory array is organized in uniform, 4 KByte erasable sectors with the following erasable blocks: eight 8 KByte parameter, two 32 KByte overlay, and thirty 64 KByte overlay blocks. See Figure 3-1. Top of Memory Block ┌──────────┐ │ 8 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 32 KByte │ ├──────────┤ │ 64 KByte │ ├──────────┤ │ 64 KByte │ ├──────────┤ │ 64 KByte │ ├──────────┤ │ 32 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 8 KByte │ ├──────────┤ │ 8 KByte │ └──────────┘ Bottom of Memory Block ┌────────────────────────────────┐ │ 64 KByte │ ├────────────────────────────────┤ │ 64 KByte │ └────────────────────────────────┘ Expanded View: ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ │ 4 KB │ │ 4 KB │ │ 4 KB │ │ 4 KB │ ├──────┤ ├──────┤ ├──────┤ ├──────┤ │ . . . (continues) . . . │ └──────┘ └──────┘ └──────┘ └──────┘ 2 Sectors for 8 KByte blocks 8 Sectors for 32 KByte blocks 16 Sectors for 64 KByte blocks Link: https://ww1.microchip.com/downloads/en/DeviceDoc/20005013D.pdf Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
2025-04-29Merge patch series "Add support for Infineon S28HL256T and S28HL02GT"Tom Rini
Takahiro Kuwano <Takahiro.Kuwano@infineon.com> says: Those are 3.0V, 256Mb/2Gb NOR Flash devices with Octal interface. Same fanctionalities with 1.8V version that are already supported. Link: https://lore.kernel.org/r/cover.1743575001.git.Takahiro.Kuwano@infineon.com
2025-04-29mtd: spi-nor-ids: Add support for S28HL02GTTakahiro Kuwano
Infineon S28HL02GT is 3.0V, 2Gb Flash device with Octal interface. It has the same functionalities with S28HS02GT. Link: https://www.infineon.com/dgdl/Infineon-S28HS02GT_S28HS04GT_S28HL02GT_S28HL04GT_2Gb_4Gb_SEMPER_Flash_Octal_interface_1.8V_3.0V-DataSheet-v01_00-EN.pdf?fileId=8ac78c8c7e7124d1017f0631e33714d9 Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2025-04-29mtd: spi-nor-ids: Add support for S28HL256TTakahiro Kuwano
Infineon S28HL256T is 3.0V, 256Mb Flash device with Octal interface. It has the same functionalities with S28HS256T. Link:https://www.infineon.com/dgdl/Infineon-S28HS256T_S28HL256T_256Mb_SEMPER_Flash_Octal_interface_1_8V_3-DataSheet-v02_00-EN.pdf?fileId=8ac78c8c8fc2dd9c018fc66787aa0657 Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2025-04-29mtd: spi-nor: Use CONFIG_IS_ENABLED for CONFIG_SPI_FLASH_BAR definesBernhard Messerklinger
At the moment a mixture of ifdef(CONFIG_IS_ENABLED) and CONFIG_IS_ENABLED(SPI_FLASH_BAR) is used in the spi-nor framework. This leads to misbehaviour in the SPL as there is no Kconfig option CONFIG_SPL_SPI_FLASH_BAR. This commit standardizes the use of CONFIG_SPI_FLASH to get SPLs that load U-Boot proper from the SPI flash to work again. Fixes: 9bb02f7 (mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled) Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
2025-04-29mtd: spi-nor: Add NO_CHIP_ERASE flag for mt35xu01g/2gVenkatesh Yadav Abbarapu
Since the opcode SPINOR_OP_CHIP_ERASE (0xc7) is not supported for the mt35xu01g/2g flashes, the NO_CHIP_ERASE flag has been added to enable sector erase functionality instead. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2025-04-08mtd: spi-nor-tiny: annotate switch/case fallthroughAndre Przywara
The SPI NOR code uses an implicit switch/case fallthrough when checking different vendors to determine how to deal with extended addressig modes. Add our "fallthrough;" statement-like macro before some label in the 4-byte addressing mode code, to avoid a warning when GCC's -Wimplicit-fallthrough warning option is enabled. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-12-30mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabledVenkatesh Yadav Abbarapu
Update the spi_nor_read() function based on the config SPI_FLASH_BAR and update the length and bank calculation by spliting the memory of 16MB size banks only when the address width is 3byte. Fix the read issue for 4byte address width by passing the entire length to the read function. Fixes: 5d40b3d384 ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-10-31mtd: spi-nor: Guard SPI_STACKED_PARALLEL with DM_SPI checkTom Rini
While we want to compile the SPI_STACKED_PARALLEL code everywhere we can, it must first be guarded with an #if for DM_SPI as not all cases where we have this code built, such as in SPL, will have the relevant DM_SPI option enabled. Fixes: 43423cdc5dc1 ("mtd: spi-nor: Always build SPI_STACKED_PARALLEL code") Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-10-31mtd: spi-nor: Always build SPI_STACKED_PARALLEL codeMarek Vasut
Prevent the code gated by SPI_STACKED_PARALLEL from bitrot by using if (CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)) around it. That way, it is always at least compiled. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Rename SPI_ADVANCE to SPI_STACKED_PARALLELMarek Vasut
The SPI_ADVANCE description does not explain what the switch does. It does not have anything to do with any advanced functionality, it only gates off support for stacked and parallel SPI NORs. Rename the Kconfig symbol, update description, and move it right next to Xilinx hardware as it seems to be specific to this hardware. Make sure the symbol is also protected by if DM_SPI in Kconfig. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Rewrite rem_bank_len calculationMarek Vasut
Rewrite the code to make it clear exactly where the SNOR_F_HAS_PARALLEL flag leads to *2 and /2 operation compared to regular code path. No functional change. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Fix multiple coding style issuesMarek Vasut
The offset variable is set, but never used afterward. Fix indent. Fix predecrement without justification. Remove use of parenthesis where unnecessary. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Remove recently added SST special caseMarek Vasut
Remove undocumented SST special case. This was added in commit 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") without any explanation in the commit message. Remove it. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Remove recently added write_disable() callMarek Vasut
Remove undocumented write_disable() call. This was added in commit 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") without any explanation in the commit message. Remove it. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Remove recently added set_4byte() callMarek Vasut
Remove undocumented set_4byte() call. This was added in commit 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") without any explanation in the commit message. Remove it. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Remove recently added spi_nor_wait_till_ready() callMarek Vasut
Remove undocumented spi_nor_wait_till_ready() call. This was added in commit 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") without any explanation in the commit message. Remove it. Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-31mtd: spi-nor: Remove recently added nor->addr_width == 3 testMarek Vasut
Remove undocumented nor->addr_width == 3 test. This was added in commit 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") without any explanation in the commit message. Remove it. This also has a bad side-effect which breaks READ operation of every SPI NOR which does not use addr_width == 3, e.g. s25fs512s does not work at all. This is because if addr_width != 3, rem_bank_len is always 0, and if rem_bank_len is 0, then read_len is 0 and if read_len is 0, then the spi_nor_read() returns -EIO. Basic reproducer is as follows: " => sf probe ; sf read 0x50000000 0 0x10000 SF: Detected s25fs512s with page size 256 Bytes, erase size 256 KiB, total 64 MiB device 0 offset 0x0, size 0x10000 SF: 65536 bytes @ 0x0 Read: ERROR -5 " Fixes: 5d40b3d384dc ("mtd: spi-nor: Add parallel and stacked memories support") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-24mtd: spi-nor: Add mt35xu01gbba octal mode SPI NOR flashHan Xu
Add SPI NOR flash id for mt35xu01gbba which supports 4 bytes address with octal mode read. Signed-off-by: Han Xu <han.xu@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2024-10-24mtd: spi-nor-ids: Add Puya Semiconductor chips descriptionDmitry Dunaev
Added support for the Puya Semiconductor chips. The datasheet can be found here: https://www.puyasemi.com/h_xilie715.html Signed-off-by: Dmitry Dunaev <dunaev@tecon.ru> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2024-10-15mtd: spi-nor: Set ECC unit size to MTD writesize in Infineon SEMPER flashesTakahiro Kuwano
The Infineon SEMPER NOR flash family uses 2-bit ECC by default with each ECC block being 16 bytes. Under this scheme multi-pass programming to an ECC block is not allowed. Set the writesize to make sure multi-pass programming is not attempted on the flash. Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-15mtd: spi-nor: Call spi_nor_post_sfdp_fixups() only after spi_nor_parse_sfdp()Takahiro Kuwano
This patch follows the upstream linux commit: 5273cc6df984("mtd: spi-nor: core: Call spi_nor_post_sfdp_fixups() only when SFDP is defined") spi_nor_post_sfdp_fixups() was called regardless of if spi_nor_parse_sfdp() had been called or not. late_init() should be instead used to initialize the parameters that are not defined in SFDP. Ideally spi_nor_post_sfdp_fixups() is called only after successful parse of SFDP. However, in case SFDP support is disabled by .config, that can break current functionality. Therefore, we would call it after spi_nor_parse_sfdp() regardless of its return value. Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-15mtd: spi-nor: Replace default_init() hook with late_init()Takahiro Kuwano
default_init() is wrong, it contributes to the maze of initializing flash parameters. We'd like to get rid of it because the flash parameters that it initializes are not really used at SFDP parsing time, thus they can be initialized later. Ideally we want SFDP to initialize all the flash parameters. If (when) SFDP tables are wrong, we fix them with the post_sfdp/bfpt hooks, to emphasize that SFDP is indeed wrong. When there are parameters that are not covered by SFDP, we initialize them in late_init() - these parameters have nothing to do with SFDP and they are not needed earlier. With this we'll have a clearer view of who initializes what. There are six default_init() hooks implemented just for initializing octal_dtr_enable() and/or setup() hooks that called later on. Just moving those to late_init() does not change functionality. Suggested-by: Tudor Ambarus <tudor.ambarus@linaro.org> Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-15mtd: spi-nor: Check nor->info before setting macronix_octal_fixupsTakahiro Kuwano
The macronix_octal_fixups should be set only when mfr and flags match. Fixes: df3d5f9e41 ("mtd: spi-nor: add support for Macronix Octal flash") Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Cc: JaimeLiao <jaimeliao.tw@gmail.com>
2024-10-15mtd: spi-nor: Allow flashes to specify MTD writesizeTakahiro Kuwano
Some flashes like the Infineon SEMPER NOR flash family use ECC. Under this ECC scheme, multi-pass writes to an ECC block is not allowed. In other words, once data is programmed to an ECC block, it can't be programmed again without erasing it first. Upper layers like file systems need to be given this information so they do not cause error conditions on the flash by attempting multi-pass programming. This can be done by setting 'writesize' in 'struct mtd_info'. Set the default to 1 but allow flashes to modify it in fixup hooks. If more flashes show up with this constraint in the future it might be worth it to add it to 'struct flash_info', but for now increasing its size is not worth it. This patch replicates the following upstream linux commit: afd473e85827 ("mtd: spi-nor: core: Allow flashes to specify MTD writesize") Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-11Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"Tom Rini
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-10mtd: spi-nor-ids: Add support for S28HS256TTakahiro Kuwano
Infineon S28HS256T is 256Mb Octal SPI device which has same functionalities with 512Mb and 1Gb parts. Link:https://www.infineon.com/dgdl/Infineon-S28HS256T_S28HL256T_256Mb_SEMPER_Flash_Octal_interface_1_8V_3-DataSheet-v02_00-EN.pdf?fileId=8ac78c8c8fc2dd9c018fc66787aa0657 Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2024-10-10mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s28hs02gtTakahiro Kuwano
S28HS02GT is dual-die package parts and do not support chip erase. Fixes: 16dd1095101 ("mtd: spi-nor-ids: Add Infineon(Cypress) s28hs02gt ID") Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-10mtd: spi-nor-ids: Add NO_CHIP_ERASE flag to Infineon s25hl02Gt and s25hs02gtTakahiro Kuwano
S25HL02GT and S25HS02GT are dual-die package parts and do not support chip erase. Fixes: c95a914aed7 ("mtd: spi-nor-ids: Add Cypress s25hl-t/s25hs-t") Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
2024-10-10Merge patch series "mtd: spi-nor: Add support for S25FS-S family"Tom Rini
tkuw584924@gmail.com <tkuw584924@gmail.com> says: From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR Flash devices with S25FS512S. Datasheets: https://www.infineon.com/dgdl/Infineon-S25FS064S_64_Mb_8_MB_FS-S_Flash_SPI_Multi-I_O_1-DataSheet-v10_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed526b25412 https://www.infineon.com/dgdl/Infineon-S25FS128S_S25FS256S_1.8_V_Serial_Peripheral_Interface_with_Multi-I_O_MirrorBit(R)_Non-Volatile_Flash-DataSheet-v15_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed6b5ab5758
2024-10-10mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDsTakahiro Kuwano
The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR Flash devices with S25FS512S. Some difference depending on the device densities are taken care in post SFDP fixup. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
2024-10-10mtd: spi-nor-id: Use INFO6 macro for S25FL-STakahiro Kuwano
The 6th ID byte is needed to distiguish S25FL-S and S25FS-S families. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Dhruva Gole <d-gole@ti.com>
2024-10-10mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-sTakahiro Kuwano
The correct 4KB erase opcode should be selected based on the address width currently used. Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s") Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Dhruva Gole <d-gole@ti.com>
2024-10-10mtd: spi-nor-ids: Extend w25q16cl entry with locking supportMarek Vasut
The w25q16cl does support locking the same way w25q16dw does, fill in the missing flags. Signed-off-by: Marek Vasut <marex@denx.de>
2024-10-10mtd: spi-nor-ids: Deduplicate mx25u25635f entryMarek Vasut
The mx25u25635f entry exists twice in spi_nor_ids, remove the less complete variant of the entry and keep only one copy of it. Fixes: f0084f1dfdbc ("drivers/mtd/spi/spi-nor-ids.c: add mx25u25635f support") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2024-10-10mtd: spi-nor-ids: Deduplicate w25q16dw entryMarek Vasut
The w25q16dw entry exists twice in spi_nor_ids, remove the less complete variant of the entry and keep only one copy of it. Fixes: baef13ec9d59 ("mtd: spi-nor-ids: Add support for flashes tested by xilinx") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2024-10-10mtd: spi-nor: Clear Winbond SR3 WPS bit on bootMarek Vasut
Some Winbond SPI NORs have special SR3 register which is used among other things to control whether non-standard "Individual Block/Sector Write Protection" (WPS bit) locking scheme is activated. This non-standard locking scheme is not supported by either U-Boot or Linux SPI NOR stack so make sure it is disabled, otherwise the SPI NOR may appear locked for no obvious reason. This SR3 WPS appears e.g. on W25Q16FW which has the same ID as W25Q16DW, but the W25Q16DW does not implement the SR3 WPS bit. Signed-off-by: Marek Vasut <marex@denx.de>
2024-10-09mtd: simplify CONFIG_DM_SPI_FLASH dependenciesHeinrich Schuchardt
CONFIG_DM_SPI depends on CONFIG_DM. There is no need to list CONFIG_DM explicitly as dependency for CONFIG_DM_SPI_FLASH Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Link: https://lore.kernel.org/r/20240604044039.27795-1-heinrich.schuchardt@canonical.com
2024-10-09spi: spi-uclass: Read chipselect and restrict capabilitiesVenkatesh Yadav Abbarapu
Read chipselect properties from DT which are populated using 'reg' property and save it in plat->cs[] array for later use. Also read multi chipselect capability which is used for parallel-memories and return errors if they are passed on using DT but driver is not capable of handling it. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-10-09mtd: spi-nor: Add parallel and stacked memories support in read_bar and ↵Ashok Reddy Soma
write_bar Add support for parallel memories and stacked memories configuration in read_bar and write_bar functions. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-10-09mtd: spi-nor: Add parallel memories support for read_sr and read_fsrAshok Reddy Soma
Add support for parallel memories flash configuration in read status register and read flag status register functions. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-10-09mtd: spi-nor: Add parallel and stacked memories supportVenkatesh Yadav Abbarapu
In parallel mode, the current implementation assumes that a maximum of two flashes are connected. The QSPI controller splits the data evenly between both the flashes so, both the flashes that are connected in parallel mode should be identical. During each operation SPI-NOR sets 0th bit for CS0 & 1st bit for CS1 in nor->flags. In stacked mode the current implementation assumes that a maximum of two flashes are connected and both the flashes are of same make but can differ in sizes. So, except the sizes all other flash parameters of both the flashes are identical Spi-nor will pass on the appropriate flash select flag to low level driver, and it will select pass all the data to that particular flash. Write operation in parallel mode are performed in page size * 2 chunks as each write operation results in writing both the flashes. For doubling the address space each operation is performed at addr/2 flash offset, where addr is the address specified by the user. Similarly for read and erase operations it will read from both flashes, so size and offset are divided by 2 and send to flash. Adding the config option SPI_ADVANCE for non SPL code. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-09-19mtd: spi-nor: scale up timeout for full-chip eraseVenkatesh Yadav Abbarapu
This patch fixes timeout issues seen on large NOR flash. For full-chip erase, where we use the SPINOR_OP_CHIP_ERASE (0xc7) opcode. Use a different timeout for full-chip erase than for other commands. [Ported from Linux kernel commit 09b6a377687b ("mtd: spi-nor: scale up timeout for full-chip erase") ] Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-08-05mtd: spi-nor: ids: Add IS25LP01GG flash supportPrasad Kummari
Add support for ISSI 128MB flash IS25LP01GG. This part supports 4byte opcodes. It also supports dual and quad read. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Link: https://lore.kernel.org/r/20240617041841.1336632-1-prasad.kummari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-07-22drivers: mtd: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-17mtd: spi-nor: Add SPI_NOR_OCTAL_READ flag for mx66uw2g345gx0 flash partPrasad Kummari
Added SPI_NOR_OCTAL_READ flag for Macronix mx66uw2g345gx0 2Gb(256MB) NOR Flash memory. Initial testing was conducted on the Versal NET board using SDR mode, which included basic erase, write, and read-back operations. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Link: https://lore.kernel.org/r/20240508052749.214286-1-prasad.kummari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>