summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* mtd: nand-imx: make sure the just created BBT is usedSascha Hauer2020-02-051-0/+4
| | | | | | | | | When we create a new BBT we write it to the flash, but the currently running barebox doesn't use it yet, only after a reboot the BBT is actually used. Call nand_default_bbt() to make sure the current barebox also used the newly created BBT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand-imx: Create BBT automatically when necessarySascha Hauer2020-02-054-227/+102
| | | | | | | | | | | | | | | Due to the differences of the logical page format and the raw page format on NAND the generic nand support can't read the bad block marker on the NAND. For this reason we have the imx_nand_bbm command which knows about these specialities and creates a BBT. The problem with this command is that one has to call it and experience shows this is often forgotten. Linux will then create a BBT based on wrong informations and the real bad blocks may be lost. With this patch we automatically create a BBT when none is found and make the command unnecssary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand-imx: do not use blocks reserved for BBTSascha Hauer2020-02-052-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | Due to the differences of the logical page format and the raw page format on NAND the generic nand support can't read the bad block marker on the NAND. For this reason we cleared the NAND_BBT_CREATE flag and have the imx_nand_bbm command to create a BBT if none is found in the flash. We have also cleared the NAND_BBT_WRITE flag which causes problems. Normally a BBT occupies two blocks in NAND, but to have some space for the BBT when one of these becomes bad we normally reserve 4 blocks for the BBT. In case we want to write the BBT to flash we have to reserve them from being written to by general NAND operations. In case we don't ever write to the BBT, as indicated by a cleared NAND_BBT_WRITE flag, the reserved blocks can be used by the general NAND operations. This way it happens that barebox uses the reserved blocks for data storage, but Linux (which has NAND_BBT_WRITE set) can't read any data from it. This results in corrupted UBI images. It's not necessary to clear the NAND_BBT_WRITE flag, all we really have to do is to prevent the BBT layer from creating a new BBT. For this it's enough to clear the NAND_BBT_CREATE flag. Fixes: 545453ddae ("mtd: nand: Add command to generate a flash BBT") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: Add support for en25qh64Ulrich Ölmann2019-12-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This is a port of Linux kernel commit | commit 30a2c8aa3c520d54bcaf3015ca8141b0156448b1 | Author: Roger Pueyo Centelles <roger.pueyo@guifi.net> | Date: Thu Feb 7 20:09:35 2019 +0100 | | mtd: spi-nor: Add support for en25qh64 | | 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: Roger Pueyo Centelles <roger.pueyo@guifi.net> | Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> | Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randfixes'Sascha Hauer2019-12-101-2/+2
|\
| * mtd: nand: don't call BBT functions if BBT support isn't builtLucas Stach2019-12-021-2/+2
| | | | | | | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: spi-nor: Add support for is25lp01gClement Leger2019-11-251-0/+2
|/ | | | | | | Add ISSI 128Mb nor flash. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: ubi: Max out wear-leveling thresholdStefan Riedmueller2019-10-144-26/+12
| | | | | | | | | | | | | | | | | | | Due to the recursive ubi_thread implementation in the barebox, a large amount of wear-leveling can lead to a stack overflow. This was observed during extensive ubi stress tests with the linux kernel and periodic power cycles. We found that if the wear-leveling threshold is exceeded and a large amount of erase blocks need wear-leveling the stack can overflow. The hardware used to observe this was a phyCORE-i.MX 6 with 1GB NAND flash. As the kernel is perfectly capable of handling wear-leveling we can disable wear-leveling in the barebox by maxing out the threshold and removing its Kconfig option. Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: nand_omap_gpmc: Fix mtd_info usageTeresa Remmet2019-09-301-8/+8
| | | | | | | | | | | The mtd_info has not been set correctly in the omap gpmc probe. Remove the mtd_info in the private struct like it has been done in other nand drivers. And update the driver accordingly. Fixes: 76b6f74c5397 ("mtd: nand: Embed struct mtd_info into struct nand_chip") Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap'Sascha Hauer2019-09-125-8/+833
|\
| * mtd: peb: Add function to write fileSascha Hauer2019-08-281-0/+84
| | | | | | | | | | | | | | | | | | This adds a function to the mtd peb API to write a file spanning multiple blocks to a mtd device. Bad blocks are automatically skipped and before anything is done we check if the image will fit into the remaining space (honouring bad blocks). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: gpmc: Add BCH16 supportSascha Hauer2019-08-281-8/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for BCH16 ECC encoding. The support is mostly taken from Linux-5.3-rc6. One major change is the different wrap mode used. The Kernel uses wrapmode 1, which means "pass all data through the BCH engine". Still the Kernel has to skip the OOB marker which is done by reading all user data, then use NAND_CMD_RNDOUT to position right behind the OOB marker and then read the ECC data. Instead of doing this we use wrap mode 4 which allows us to bypass the OOB marker from the BCH engine automatically. This explains bch_wrapmode = 1, eccsize0 = 0, eccsize1 = 52 vs. bch_wrapmode = 4, eccsize0 = 4, eccsize1 = 52 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: gpmc: Add support for ELMSascha Hauer2019-08-283-0/+424
| | | | | | | | | | | | | | | | This adds support for the ELM (Error Location Module) found on not-too-old OMAP SoCs. The driver has been taken from Linux-5.3-rc6 with interrupt support removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2019-09-1215-219/+215
|\ \
| * | mtd: spi-nor: Import missing Micron devicesAndrey Smirnov2019-09-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Import entries for n25q00a, mt25qu02g, mt25ql02g, supported by latest Linux kernel. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: spi-nor: Add support for s25fl128s0 s25fl128s1 flashes from LinuxDU HUANPENG2019-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | These definitions are taken from Linux's spi-nor driver as of v5.2-rc4 Signed-off-by: DU HUANPENG <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Embed struct mtd_info into struct nand_chipSascha Hauer2019-08-2610-52/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to what is done in the Kernel. In the Kernel we have a struct nand_device embedded into struct nand_chip and the nand_device has an mtd_info embedded into it. Until we have struct nand_device we embed mtd_info directly into the nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: denali: Add variables for mtd_info and nand_chipSascha Hauer2019-08-261-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | Accessing the mtd_info from the nand_chip will change in the next patch, so instead of accessing it each time when used create a variable for mtd_info to keep the next patch smaller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: nand: Add and use static inline wrapper for getting nand_chip from mtdSascha Hauer2019-08-2612-118/+118
| |/ | | | | | | | | | | | | | | | | All drivers in tree use mtd->priv for the nand_chip. Add and use a static inline wrapper mtd_to_nand() which we already have in the kernel for getting the nand_chip from the mtd_info struct. Next step would be to embed a struct mtd_info into struct nand_chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: spi-nor: add support for sst26vf seriesOleksij Rempel2019-08-211-0/+25
| | | | | | | | | | | | | | | | Ported from linux-4.19-at91 linux4sam_6.1 and needed for SAMA5D27 SOM1 EK. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: spi-nor: add UNLOCK_GLOBAL_BLOCK supportOleksij Rempel2019-08-211-1/+24
|/ | | | | | | | Ported from linux-4.19-at91 linux4sam_6.1 and needed for SAMA5D27 SOM1 EK. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd-gpmi-nand'Sascha Hauer2019-08-152-118/+182
|\
| * mtd: nand-mxs: Make ecc strength configurable via device treeSascha Hauer2019-08-061-4/+21
| | | | | | | | | | | | | | | | | | | | | | According to the binding doc the mxs NAND driver supports the "nand-ecc-strength" and "nand-ecc-step-size" options. This adds support for these options to the driver. The "nand-ecc-step-size" is not really configurable, the only accepted value is 512 so this is merely to sanity check that there's nothing specified that we can't yet support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand: Add function to parse device tree propertiesSascha Hauer2019-08-061-0/+27
| | | | | | | | | | | | | | This adds nand_of_parse_node() which can be used to parse generic NAND device properties. Not very complete yet, but it's a start. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: inline only once used functionSascha Hauer2019-08-061-6/+1
| | | | | | | | | | | | | | mxs_nand_ecc_size_in_bits() is used only once and is simple enough to be inlined. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: pass mtd_info to mxs_nand_get_mark_offset()Sascha Hauer2019-08-061-6/+5
| | | | | | | | | | | | | | struct mtd_info * contains everything mxs_nand_get_mark_offset() needs, so pass this pointer rather than several integer arguments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: change API between NAND driver and fcb codeSascha Hauer2019-08-061-29/+33
| | | | | | | | | | | | | | | | | | | | | | | | The imx-bbu-nand-fcb update handler code calls into the NAND driver to get the ecc strength and bad block marker position. Change the API so that only a single function is necessary and not three functions. Also in future the ecc strength will be configurable via device tree. This means static parameters like page size / oob size are no longer enough to calculate the ecc strength and so we store a pointer to our mtd_info struct in a static global variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: Make locally used variable staticSascha Hauer2019-08-061-3/+1
| | | | | | | | | | | | | | fake_ecc_layout is only used in the mxs nand driver, so make it static. Also it's not necessary to zero the structure. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: calculate ecc_strength only onceSascha Hauer2019-08-061-12/+36
| | | | | | | | | | | | | | | | | | | | Instead of calculating the ecc strength multiple times with each page read just do it once and store the result in chip->ecc.strength. While at it also store the correct value in chip->ecc.bytes instead of writing a bogus value into it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: nand-mxs: consistently rename struct nand_chip * to "chip"Sascha Hauer2019-08-061-74/+74
| | | | | | | | | | | | | | The struct nand_chip * is sometimes named "nand" and sometimes "chip". For consistency name it "chip" throughout the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: spi-nor: fix page offset/remains calculation in spi_nor_writeBastian Krause2019-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nor->write() simply adds the number of written bytes to the pointer given. Thus retval is incremented in each loop cycle for each spi_nor_write() call without ever resetting it. This leads to wrong page offset/remains calculations and an incorrect number of bytes written to retlen. This becomes apparant only if the calling function actually compares len and retlen (e.g. mtd_peb_write() ). Otherwise wrong data is written: $ memcpy -s /dev/prng -d prng_data 0 0 10k $ erase /dev/mtd0.mypart $ cp prng_data /dev/mtd0.mypart $ memcmp -s prng_data -d /dev/mtd0.mypart 0 0 memcmp returned "files differ" before, with this patch it returns "OK". Fixes: c8516869c4 ("spi: Extend the core to ease integration of SPI memory controllers") Signed-off-by: Bastian Krause <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: nand: Add ecc parameters as device parametersSascha Hauer2019-07-181-0/+4
| | | | | | | | | | | | | | The ecc strength/bytes/size values are useful informations sometimes, add them as device parameters. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | UBI: silence erroneous GCC warning about uninitialized readAhmad Fatoum2019-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC reports following use of an uninitialized variable: ./drivers/mtd/ubi/eba.c: In function 'try_write_vid_and_data': ./drivers/mtd/ubi/eba.c:904:9: warning: 'opnum' may be used uninitialized in this function [-Wmaybe-uninitialized] err = ubi_wl_put_peb(ubi, vol_id, lnum, opnum, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is incorrect, because it's only called when err == 0 and opnum is always initialized if err == 0. Silence the warning by initializing a variable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: peb: Do not mark as bad in mtd_peb_torture()Sascha Hauer2019-07-161-6/+3
| | | | | | | | | | | | | | | | | | | | | | Both the Kernel and mtd-utils have peb torture functions and both do not mark the block as bad automatically. Instead, the caller must mark the block as bad when -EIO is returned from the torture function. Do the same in barebox. This is necessary as the UBI code otherwise may mark a block as bad twice: Once indirectly in mtd_peb_torture() and then directly afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: ubi: mark PEBs as bad on erase failureSascha Hauer2019-07-153-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | 70542a9c65 converted UBI to use mtd_peb_torture(). It was assumed that a block was marked as bad when it didn't pass the torture test. However, not all possibly bad blocks went through the torture test, so it could happen that a block that could not be erased was still kept as good block. This patch fixes this and explicitly calls ubi_io_mark_bad() when a block cannot be erased. Fixes: 70542a9c65 ("mtd: ubi: Use mtd_peb_torture") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: spi-nor: Add support for ISSI flashes from LinuxUwe Kleine-König2019-06-171-0/+21
|/ | | | | | | The definitions are taken from Linux's spi-nor driver as of v5.2-rc4. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-06-111-1/+1
|\
| * treewide: replace '---help---' with 'help' in Kconfig filesMasahiro Yamada2019-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Linux, '---help---' was deprecated in favor of 'help', and this is checked by the recent checkpatch.pl See Linux commit 84af7a6194e493fae312a2b7fa5a3b51f76d9282 The number of '---help---' is gradually decreasing in Linux, but there are still lots. However, '---help---' will be completely killed when the time comes. Fortunately, there are only some in Barebox. Replacing them is not hard. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | nand: nand_mxs: Do not zero out DMA coherent memoryAndrey Smirnov2019-05-281-3/+0
|/ | | | | | | | Memory returned by dma_alloc_coherent() should already be zeroed out, so there's no need to do this explicitly. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/qspi'Sascha Hauer2019-05-104-365/+725
|\
| * mtd: spi-nor: Add support for more Macronix devicesSascha Hauer2019-05-081-0/+3
| | | | | | | | | | | | Add support for the Macronix mx66u51235f, mx66l1g45g and mx66l1g55g. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: devices: m25p80: use the spi_mem_xx() APISteffen Trumtrar2019-05-082-82/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the barebox adoption of the linux v4.16 patch 4120f8d158ef904fb305b27e4a4524649faf3096 Author: Boris Brezillon <bbrezillon@kernel.org> AuthorDate: Thu Apr 26 18:18:19 2018 +0200 Commit: Mark Brown <broonie@kernel.org> CommitDate: Fri May 11 11:33:51 2018 +0900 mtd: spi-nor: Use the spi_mem_xx() API The spi_mem_xxx() API has been introduced to replace the spi_flash_read() one. Make use of it so we can get rid of spi_flash_read(). Note that using spi_mem_xx() also simplifies the code because this API takes care of using the regular spi_sync() interface when the optimized ->mem_ops interface is not implemented by the controller. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: spi-nor: provide default erase_sector implementationSteffen Trumtrar2019-05-081-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the Linux v4.4 patch commit c67cbb839da9cc2757eabfa128556db6a2baf160 Author: Brian Norris <computersforpeace@gmail.com> AuthorDate: Tue Nov 10 12:15:27 2015 -0800 Commit: Brian Norris <computersforpeace@gmail.com> CommitDate: Thu Nov 19 13:34:44 2015 -0800 mtd: spi-nor: provide default erase_sector implementation Some spi-nor drivers perform sector erase by duplicating their write_reg() command. Let's not require that the driver fill this out, and provide a default instead. Tested on m25p80.c and Medatek's MT8173 SPI NOR flash driver. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocolsSteffen Trumtrar2019-05-083-204/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync the driver with Linux v4.12 and apply the patch commit cfc5604c488ccd17936b69008af0c9ae050f4a08 Author: Cyrille Pitchen <cyrille.pitchen@atmel.com> AuthorDate: Tue Apr 25 22:08:46 2017 +0200 Commit: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> CommitDate: Mon May 15 21:56:17 2017 +0200 mtd: spi-nor: introduce SPI 1-2-2 and SPI 1-4-4 protocols 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: Cyrille Pitchen <cyrille.pitchen@atmel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: spi-nor: remove unused write_enable from write_regSteffen Trumtrar2019-05-083-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the Linux v4.2 commit: commit f9f3ce835ddce3c669eee869253105f88819888b Author: Jagan Teki <jteki@openedev.com> AuthorDate: Wed Aug 19 15:26:44 2015 +0530 Commit: Brian Norris <computersforpeace@gmail.com> CommitDate: Fri Sep 11 16:04:55 2015 -0700 mtd: spi-nor: Zap unneeded write_enable from write_reg The 'write_enable' argument is unused and unneeded, so remove it from the API. Signed-off-by: Jagan Teki <jteki@openedev.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Han Xu <han.xu@freescale.com> [Brian: fixed for nxp-spifi.c] Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: Extend the core to ease integration of SPI memory controllersSteffen Trumtrar2019-05-081-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync with Linux v5.1-rc1. This is the barebox adoption of the commit commit c36ff266dc82f4ae797a6f3513c6ffa344f7f1c7 Author: Boris Brezillon <boris.brezillon@bootlin.com> Date: Thu Apr 26 18:18:14 2018 +0200 spi: Extend the core to ease integration of SPI memory controllers Some controllers are exposing high-level interfaces to access various kind of SPI memories. Unfortunately they do not fit in the current spi_controller model and usually have drivers placed in drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI memories in general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * mtd: spi-nor: cadence: add cqspi_set_protocolSteffen Trumtrar2019-05-081-63/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | Sync up the driver with the original linux v4.7 driver version. As only Quad-SPI mode is/was supported, the function was not ported in the initial move to barebox. To make future synchronizations with the kernel driver easier, add this function and reorder the functions in the driver accordingly. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-05-101-1/+0
|\ \
| * | UBI: remove Kconfig entry from includeJan Remmet2019-05-061-1/+0
| |/ | | | | | | | | | | | | | | CONFIG_MTD_UBI_WL_THRESHOLD can be set via Kconfig. default there is also 4096. So remove the leftover here. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / mtd: spi-nor: add Winbond W25Q40BWAlexander Kurz2019-04-231-0/+1
|/ | | | | | | This 4MBit SPI chip can be found in Kindle Voyage devices Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>