summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mtd/for-6.2' of ↵Linus Torvalds2022-12-1331-887/+665
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd updates from Miquel Raynal: "MTD core changes: - Fix refcount error in del_mtd_device() - Fix possible resource leak in init_mtd() - Set ROOT_DEV for partitions marked as rootfs in DT - Describe marking rootfs partitions in the bindings - Fix device name leak when register device fails in add_mtd_device() - Try to find OF node for every MTD partition - simplify (a bit) code find partition-matching dynamic OF node MTD driver changes: - pxa2xx-flash maps: fix memory leak in probe - BCM parser: refer to ARCH_BCMBCA instead of ARCH_BCM4908 - lpddr2_nvm: Fix possible null-ptr-deref - inftlcore: fix repeated words in comments - lart: remove driver - tplink: - Add TP-Link SafeLoader partitions table parser and bindings - Describe TP-Link SafeLoader parser - Describe TP-Link SafeLoader dynamic subpartitions - mtdoops: - Panic caused mtdoops to call mtdoops_erase function immediately - Add mtdoops_erase function and move mtdoops_inc_counter after it - Change printk() to counterpart pr_ functions MTD binding cleanup: - Fixed-partitions: Fix 'sercomm,scpart-id' schema - Standardize the style in the examples - Drop object types when referencing other files - Argue in favor of keeping additionalProperties set to true - NVMEM-cells: - Inherit from MTD partitions - Drop range property from example - Partitions: - Change qcom,smem-part partition type - Constrain the list of parsers - Physmap: Reuse the generic definitions - SPI-NOR: Drop common properties - Sunxi-nand: Add an example to validate the bindings - Onenand: Mention the expected node name - Ingenic: Mark partitions in the controller node as deprecated - NAND: - Standardize the child node name - Drop common properties already defined in generic files - nand-chip.yaml should reference mtd.yaml - Remove useless file about partitions - Clarify all partition subnodes SPI NOR core changes: - Add support for flash reset using the dt reset-gpios property. - Update hwcaps.mask to include 8D-8D-8D read and page program ops when xSPI profile 1.0 table is defined. - Bypass zero erase size in spi_nor_find_best_erase_type(). - Fix select_uniform_erase to skip 0 erase size - Add generic flash driver. If a flash is not found in the flash_info array, fall back to the generic flash driver which is described solely by the flash's SFDP tables. - Fix the number of bytes for the dummy cycles in spi_nor_spimem_check_readop(). - Introduce SPI_NOR_QUAD_PP flag, as PP_1_1_4 is not SFDP discoverable. SPI NOR manufacturer drivers changes: - Spansion: - use PARSE_SFDP for s28hs512t, - add support for s28hl512t, s28hl01gt, and s28hs01gt. - Gigadevice: Replace default_init() with post_bfpt() for gd25q256. - Micron - ST: Enable locking for mt25qu256a. - Winbond: Add support for W25Q512NW-IQ. - ISSI: Use PARSE_SFDP and SPI_NOR_QUAD_PP. Raw NAND core changes: - Drop obsolete dependencies on COMPILE_TEST - MAINTAINERS: rectify entry for MESON NAND controller bindings - Drop EXPORT_SYMBOL_GPL for nanddev_erase() Raw NAND driver changes: - marvell: Enable NFC/DEVBUS arbiter - gpmi: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync - mpc5121: Replace NO_IRQ by 0 - lpc32xx_{slc,mlc}: - Switch to using pm_ptr() - Switch to using gpiod API - lpc32xx_mlc: Switch to using pm_ptr() - cadence: Support 64-bit slave dma interface - rockchip: Describe rk3128-nfc in the bindings - brcmnand: Update interrupts description in the bindings SPI-NAND driver changes: - winbond: - Add Winbond W25N02KV flash support - Fix flash identification" * tag 'mtd/for-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (76 commits) mtd: rawnand: Drop obsolete dependencies on COMPILE_TEST mtd: maps: pxa2xx-flash: fix memory leak in probe mtd: core: Fix refcount error in del_mtd_device() mtd: spi-nor: add SFDP fixups for Quad Page Program mtd: spi-nor: issi: is25wp256: Init flash based on SFDP mtd: spi-nor: winbond: add support for W25Q512NW-IQ mtd: spi-nor: micron-st: Enable locking for mt25qu256a mtd: spi-nor: Fix the number of bytes for the dummy cycles mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt mtd: spi-nor: Fix formatting in spi_nor_read_raw() kerneldoc comment mtd: spi-nor: sysfs: print JEDEC ID for generic flash driver mtd: spi-nor: add generic flash driver mtd: spi-nor: fix select_uniform_erase to skip 0 erase size mtd: spi-nor: move function declaration out of sfdp.h mtd: spi-nor: remember full JEDEC flash ID mtd: spi-nor: sysfs: hide manufacturer if it is not set mtd: spi-nor: hide jedec_id sysfs attribute if not present mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type() mtd: rawnand: marvell: Enable NFC/DEVBUS arbiter mtd: parsers: refer to ARCH_BCMBCA instead of ARCH_BCM4908 ...
| * Merge tag 'spi-nor/for-6.2' into mtd/nextMiquel Raynal2022-12-0511-45/+211
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPI NOR core changes: * Add support for flash reset using the dt reset-gpios property. * Update hwcaps.mask to include 8D-8D-8D read and page program ops when xSPI profile 1.0 table is defined. * Bypass zero erase size in spi_nor_find_best_erase_type(). * Fix select_uniform_erase to skip 0 erase size * Add generic flash driver. If a flash is not found in the flash_info array, fall back to the generic flash driver which is described solely by the flash's SFDP tables. * Fix the number of bytes for the dummy cycles in spi_nor_spimem_check_readop(). * Introduce SPI_NOR_QUAD_PP flag, as PP_1_1_4 is not SFDP discoverable. SPI NOR manufacturer drivers changes: * Spansion: - use PARSE_SFDP for s28hs512t, - add support for s28hl512t, s28hl01gt, and s28hs01gt. * Gigadevice: Replace default_init() with post_bfpt() for gd25q256. * Micron - ST: Enable locking for mt25qu256a. * Winbond: Add support for W25Q512NW-IQ. * ISSI: Use PARSE_SFDP and SPI_NOR_QUAD_PP. Fix merge conflict in the jedec,spi-nor bindings. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| | * mtd: spi-nor: add SFDP fixups for Quad Page ProgramSudip Mukherjee2022-11-223-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SFDP table of some flash chips do not advertise support of Quad Input Page Program even though it has support. Use flags and add hardware cap for these chips. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@sifive.com> [tudor.ambarus@microchip.com: move pp setting in spi_nor_init_default_params] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220920184808.44876-2-sudip.mukherjee@sifive.com
| | * mtd: spi-nor: issi: is25wp256: Init flash based on SFDPSudip Mukherjee2022-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The datasheet of is25wp256 says it supports SFDP. Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Testing showed the flash using SPINOR_OP_READ_1_1_4_4B 0x6c, SPINOR_OP_PP_4B 0x12 and SPINOR_OP_BE_4K_4B 0x21 before enabling SFDP. After this patch, it parses the SFDP information and still uses the same opcodes. Set sector_size and n_sectors to zero as they will be discovered when parsing SFDP. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@sifive.com> [tudor.ambarus@microchip.com: set sector_size and n_sectors to zero] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220920184808.44876-1-sudip.mukherjee@sifive.com
| | * mtd: spi-nor: winbond: add support for W25Q512NW-IQJae Hyun Yoo2022-11-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Winbond W25Q512NW-IQ/IN Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://www.winbond.com/resource-files/W25Q512NW%20RevB%2007192021.pdf Link: https://lore.kernel.org/r/20220716000643.3541839-2-quic_jaehyoo@quicinc.com
| | * mtd: spi-nor: micron-st: Enable locking for mt25qu256aEliav Farber2022-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mt25qu256a [1] uses the 4 bit Block Protection scheme and supports Top/Bottom protection via the BP and TB bits of the Status Register. BP3 is located in bit 6 of the Status Register. Tested on MT25QU256ABA8ESF-0SIT. [1] https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/mt25q/die-rev-a/mt25q_qljs_u_256_aba_0.pdf Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20221020092058.33844-1-farbere@amazon.com
| | * mtd: spi-nor: Fix the number of bytes for the dummy cyclesAllen-KH Cheng2022-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The number of bytes used by spi_nor_spimem_check_readop() may be incorrect for the dummy cycles. Since nor->read_dummy is not initialized before spi_nor_spimem_adjust_hwcaps(). We use both mode and wait state clock cycles instead of nor->read_dummy. Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol") Co-developed-by: Bayi Cheng <bayi.cheng@mediatek.com> Signed-off-by: Bayi Cheng <bayi.cheng@mediatek.com> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Tested-by: Dhruva Gole <d-gole@ti.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Link: https://lore.kernel.org/r/20221031124633.13189-1-allen-kh.cheng@mediatek.com
| | * mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with ↵Yaliang Wang2022-11-211-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gd25q256_post_bfpt When utilizing PARSE_SFDP to initialize the flash parameter, the deprecated initializing method spi_nor_init_params_deprecated() and the function spi_nor_manufacturer_init_params() within it will never be executed, which results in the default_init hook function will also never be executed. This is okay for 'D' generation of GD25Q256, because 'D' generation is implementing the JESD216B standards, it has QER field defined in BFPT, parsing the SFDP can properly set the quad_enable function. The 'E' generation also implements the JESD216B standards, and it has the same status register definitions as 'D' generation, parsing the SFDP to set the quad_enable function should also work for 'E' generation. However, the same thing can't apply to 'C' generation. 'C' generation 'GD25Q256C' implements the JESD216 standards, and it doesn't have the QER field defined in BFPT, since it does have QE bit in status register 1, the quad_enable hook needs to be tweaked to properly set the quad_enable function, this can be done in post_bfpt fixup hook. Fixes: 047275f7de18 ("mtd: spi-nor: gigadevice: gd25q256: Init flash based on SFDP") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Yaliang Wang <Yaliang.Wang@windriver.com> [tudor.ambarus@microchip.com: Update comment in gd25q256_post_bfpt] Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221016171901.1483542-2-yaliang.wang@windriver.com
| | * mtd: spi-nor: Fix formatting in spi_nor_read_raw() kerneldoc commentJonathan Neuschäfer2022-11-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to put "set" on its own line like that. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Acked-by: Pratyush Yadav <pratyush@kernel.org> Link: https://lore.kernel.org/r/20221101162906.990125-1-j.neuschaefer@gmx.net
| | * mtd: spi-nor: sysfs: print JEDEC ID for generic flash driverMichael Walle2022-11-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have a database entry for the generic SPI-NOR flash driver and thus we don't have a JEDEC ID to print. Print the (cached) JEDEC ID instead. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-8-michael@walle.cc
| | * mtd: spi-nor: add generic flash driverMichael Walle2022-11-213-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our SFDP parsing is everything we need to support all basic operations of a flash device. If the flash isn't found in our in-kernel flash database, gracefully fall back to a driver described solely by its SFDP tables. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Tested-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-7-michael@walle.cc
| | * mtd: spi-nor: fix select_uniform_erase to skip 0 erase sizeMichael Walle2022-11-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4bait will set the erase size to 0 if there is no corresponding opcode for the 4byte erase. Fix spi_nor_select_uniform_erase to skip the 0 erase size to avoid mtd device registration failure cases. Reported-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com> Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220810220654.1297699-6-michael@walle.cc
| | * mtd: spi-nor: move function declaration out of sfdp.hMichael Walle2022-11-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sfdp.h should only contain constants related to the JEDEC SFDP specification(s). Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-5-michael@walle.cc
| | * mtd: spi-nor: remember full JEDEC flash IDMichael Walle2022-11-212-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, we print the JEDEC ID that is stored in our database. The generic flash support won't have such an entry in our database. To find out the JEDEC ID later we will have to cache it. There is also another advantage: If the flash is found in the database, the ID could be truncated because the ID of the entry is used which can be shorter. Some flashes still holds valuable information in the bytes after the JEDEC ID and come in handy during debugging of when coping with INFO6() entries. These are not accessible for now. Save a copy of the ID bytes after reading and display it via debugfs. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-4-michael@walle.cc
| | * mtd: spi-nor: sysfs: hide manufacturer if it is not setMichael Walle2022-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manufacturer may be optional when pure SFDP flashes are supported. Hide the sysfs property if no manufacturer is set. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-3-michael@walle.cc
| | * mtd: spi-nor: hide jedec_id sysfs attribute if not presentMichael Walle2022-11-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some non-jedec compliant flashes (like the Everspin flashes) don't have an ID at all. Hide the attribute in this case. Fixes: 36ac02286265 ("mtd: spi-nor: add initial sysfs support") Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220810220654.1297699-2-michael@walle.cc
| | * mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type()Alexander Sverdlin2022-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erase can be zeroed in spi_nor_parse_4bait() or spi_nor_init_non_uniform_erase_map(). In practice it happened with mt25qu256a, which supports 4K, 32K, 64K erases with 3b address commands, but only 4K and 64K erase with 4b address commands. Fixes: dc92843159a7 ("mtd: spi-nor: fix erase_type array to indicate current map conf") Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211119081412.29732-1-alexander.sverdlin@nokia.com
| | * mtd: spi-nor: core: Add an error message when failing to exit the 4-byte ↵Tudor Ambarus2022-10-251-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | address mode Add an error message when failing to exit the 4-byte address mode. Do not stop the execution and go through the spi_nor_soft_reset() method if used, in the hope that the flash will default to 3-byte address mode after the reset. Suggested-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20220728030159.68680-1-tudor.ambarus@microchip.com
| | * mtd: spi-nor: micron-st.c: Replace hardcoded values for ↵Tudor Ambarus2022-10-251-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | addr_nbytes/addr_mode_nbytes We track in the core the internal address mode of the flash. Stop using hardcoded values for the number of bytes of address and use nor->addr_nbytes and nor->params->addr_mode_nbytes instead. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220728041451.85559-3-tudor.ambarus@microchip.com
| | * mtd: spi-nor: spansion: Replace hardcoded values for ↵Tudor Ambarus2022-10-251-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | addr_nbytes/addr_mode_nbytes We track in the core the internal address mode of the flash. Stop using hardcoded values for the number of bytes of address and use nor->addr_nbytes and nor->params->addr_mode_nbytes instead. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Tested-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Link: https://lore.kernel.org/r/20220728041451.85559-2-tudor.ambarus@microchip.com
| | * mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt infoTakahiro Kuwano2022-10-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt. These devices have the same functionality as s28hs512t. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/6350ac204c58b94b30d70c529bf194d953085ac6.1661915569.git.Takahiro.Kuwano@infineon.com
| | * mtd: spi-nor: spansion: Rename s28hs512t prefixTakahiro Kuwano2022-10-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change prefix to support all other devices in SEMPER S28 family. Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/8cf6bc9bffd50e486867c0817de1fa56c5d308ec.1661915569.git.Takahiro.Kuwano@infineon.com
| | * mtd: spi-nor: spansion: Remove NO_SFDP_FLAGS from s28hs512t infoTakahiro Kuwano2022-10-251-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Read, Page Program, and Sector Erase settings are done in SFDP so we can remove NO_SFDP_FLAGS from s28hs512t info. Since the default_init() is no longer called after removing NO_SFDP_FLAGS, the initialization in the default_init() is moved to late_init(). Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/12e468992f5d0cbd474abff3203100cc8163d4e5.1661915569.git.Takahiro.Kuwano@infineon.com
| | * mtd: spi-nor: sfdp: Update params->hwcaps.mask at xSPI profile 1.0 table parseTakahiro Kuwano2022-10-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existece of xSPI profile 1.0 table implies that the flash supports read and program in 8D-8D-8D mode. Update the params->hwcaps.mask in spi_nor_parase_profile1(). Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/1b449bae6978f11f7636f2b5acb6435723963f59.1661915569.git.Takahiro.Kuwano@infineon.com
| | * mtd: spi-nor: Add support for flash resetSai Krishna Potthuri2022-10-251-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for spi-nor flash reset via GPIO controller by reading the reset-gpio property. If there is a valid GPIO specifier then reset will be performed by asserting and deasserting the GPIO using gpiod APIs otherwise it will not perform any operation. Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20220908064428.2962-3-sai.krishna.potthuri@amd.com
| * | Merge tag 'nand/for-6.2' into mtd/nextMiquel Raynal2022-12-059-78/+187
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raw NAND core changes: * Drop obsolete dependencies on COMPILE_TEST * MAINTAINERS: rectify entry for MESON NAND controller bindings * Drop EXPORT_SYMBOL_GPL for nanddev_erase() Raw NAND driver changes: * marvell: Enable NFC/DEVBUS arbiter * gpmi: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync * mpc5121: Replace NO_IRQ by 0 * lpc32xx_{slc,mlc}: - Switch to using pm_ptr() - Switch to using gpiod API * lpc32xx_mlc: Switch to using pm_ptr() * cadence: Support 64-bit slave dma interface * rockchip: Describe rk3128-nfc in the bindings * brcmnand: Update interrupts description in the bindings SPI-NAND driver changes: * winbond: - Add Winbond W25N02KV flash support - Fix flash identification Fix merge conflict with mtd tree regarding the brcm bindings. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
| | * | mtd: rawnand: Drop obsolete dependencies on COMPILE_TESTJean Delvare2022-11-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: Naga Sureshkumar Relli <nagasure@xilinx.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221124115946.5edb771c@endymion.delvare
| | * | mtd: rawnand: marvell: Enable NFC/DEVBUS arbiterHamish Martin2022-11-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CN9130 SoC (an ARMADA 8K type) has both a NAND Flash Controller and a generic local bus controller (Device Bus Controller) that share common pins. With a board design that incorporates both a NAND flash and uses the Device Bus (in our case for an SRAM) accessing the Device Bus device fails unless the NfArbiterEn bit is set. Setting the bit enables arbitration between the Device Bus and the NAND flash. Since there is no obvious downside in enabling this for designs that don't require arbitration, we always enable it. Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221109231325.7714-1-hamish.martin@alliedtelesis.co.nz
| | * | mtd: rawnand: lpc32xx_slc: Switch to using pm_ptr()Geert Uytterhoeven2022-11-071-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The switch to using the gpiod API removed the last user of lpc32xx_wp_disable() outside #ifdef CONFIG_PM, causing build failures if CONFIG_PM=n: drivers/mtd/nand/raw/lpc32xx_slc.c:318:13: error: ‘lpc32xx_wp_disable’ defined but not used [-Werror=unused-function] 318 | static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host) | ^~~~~~~~~~~~~~~~~~ Fix this by switching from #ifdef CONFIG_PM to pm_ptr(), increasing compile-coverage as a side-effect. Reported-by: noreply@ellerman.id.au Fixes: 6b923db2867cb5e1 ("mtd: rawnand: lpc32xx_slc: switch to using gpiod API") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221027131028.3838303-2-geert@linux-m68k.org
| | * | mtd: rawnand: lpc32xx_mlc: Switch to using pm_ptr()Geert Uytterhoeven2022-11-071-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The switch to using the gpiod API removed the last user of lpc32xx_wp_disable() outside #ifdef CONFIG_PM, causing build failures if CONFIG_PM=n: drivers/mtd/nand/raw/lpc32xx_mlc.c:380:13: error: ‘lpc32xx_wp_disable’ defined but not used [-Werror=unused-function] 380 | static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host) | ^~~~~~~~~~~~~~~~~~ Fix this by switching from #ifdef CONFIG_PM to pm_ptr(), increasing compile-coverage as a side-effect. Reported-by: noreply@ellerman.id.au Fixes: 782e32a990d9d702 ("mtd: rawnand: lpc32xx_mlc: switch to using gpiod API") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221027131028.3838303-1-geert@linux-m68k.org
| | * | mtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase()Dario Binacchi2022-11-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is only used within this module, so it is no longer necessary to use EXPORT_SYMBOL_GPL(). Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221018170205.1733958-1-dario.binacchi@amarulasolutions.com
| | * | mtd: rawnand: cadence: support 64-bit slave dma interfaceValentin Korenblit2022-10-181-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 32-bit accesses on 64-bit sdma trigger sdma_err in intr_status register. Check dma capabilities before reading/writing from/to sdma interface. Link: https://lore.kernel.org/all/b7e5ebb4-0de8-4958-9bc4-fe06ec4c3635@www.fastmail.com/t/ Signed-off-by: Valentin Korenblit <vkorenblit@sequans.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221018093000.12072-1-vkorenblit@sequans.com
| | * | mtd: spinand: winbond: add Winbond W25N02KV flash supportMikhail Kshevetskiy2022-10-181-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of Winbond W25N02KV flash Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-2-mikhail.kshevetskiy@iopsys.eu
| | * | mtd: spinand: winbond: fix flash identificationMikhail Kshevetskiy2022-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Winbond uses 3 bytes to identify flash: vendor_id, dev_id_0, dev_id_1, but current driver uses only first 2 bytes of it for devices identification. As result Winbond W25N02KV flash (id_bytes: EF, AA, 22) is identified as W25N01GV (id_bytes: EF, AA, 21). Fix this by adding missed identification bytes. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-1-mikhail.kshevetskiy@iopsys.eu
| | * | mtd: rawnand: mpc5121: Replace NO_IRQ by 0Christophe Leroy2022-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NO_IRQ is used to check the return of irq_of_parse_and_map(). On some architecture NO_IRQ is 0, on other architectures it is -1. irq_of_parse_and_map() returns 0 on error, independent of NO_IRQ. So use 0 instead of using NO_IRQ. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/4e3ca3e0077ea124ea210c312e6e620f0f9e8bca.1665034065.git.christophe.leroy@csgroup.eu
| | * | mtd: rawnand: lpc32xx_slc: switch to using gpiod APIDmitry Torokhov2022-10-181-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the driver from legacy gpio API to a newer gpiod API. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220928230019.2140896-2-dmitry.torokhov@gmail.com
| | * | mtd: rawnand: lpc32xx_mlc: switch to using gpiod APIDmitry Torokhov2022-10-181-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the driver from legacy gpio API to a newer gpiod API. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220928230019.2140896-1-dmitry.torokhov@gmail.com
| | * | mtd: rawnand: gpmi: using pm_runtime_resume_and_get instead of ↵Zhang Qilong2022-10-181-8/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pm_runtime_get_sync Using the newest pm_runtime_resume_and_get is more appropriate for simplifing code here. Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220922150654.117568-1-zhangqilong3@huawei.com
| * | mtd: maps: pxa2xx-flash: fix memory leak in probeZheng Yongjun2022-11-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Free 'info' upon remapping error to avoid a memory leak. Fixes: e644f7d62894 ("[MTD] MAPS: Merge Lubbock and Mainstone drivers into common PXA2xx driver") Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> [<miquel.raynal@bootlin.com>: Reword the commit log] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221119073307.22929-1-zhengyongjun3@huawei.com
| * | mtd: core: Fix refcount error in del_mtd_device()Shang XiaoJing2022-11-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | del_mtd_device() will call of_node_put() to mtd_get_of_node(mtd), which is mtd->dev.of_node. However, memset(&mtd->dev, 0) is called before of_node_put(). As the result, of_node_put() won't do anything in del_mtd_device(), and causes the refcount leak. del_mtd_device() memset(&mtd->dev, 0, sizeof(mtd->dev) # clear mtd->dev of_node_put() mtd_get_of_node(mtd) # mtd->dev is cleared, can't locate of_node # of_node_put(NULL) won't do anything Fix the error by caching the pointer of the device_node. OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /spi/spi-sram@0 CPU: 3 PID: 275 Comm: python3 Tainted: G N 6.1.0-rc3+ #54 0d8a1edddf51f172ff5226989a7565c6313b08e2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x67/0x83 kobject_get+0x155/0x160 of_node_get+0x1f/0x30 of_fwnode_get+0x43/0x70 fwnode_handle_get+0x54/0x80 fwnode_get_nth_parent+0xc9/0xe0 fwnode_full_name_string+0x3f/0xa0 device_node_string+0x30f/0x750 pointer+0x598/0x7a0 vsnprintf+0x62d/0x9b0 ... cfs_overlay_release+0x30/0x90 config_item_release+0xbe/0x1a0 config_item_put+0x5e/0x80 configfs_rmdir+0x3bd/0x540 vfs_rmdir+0x18c/0x320 do_rmdir+0x198/0x330 __x64_sys_rmdir+0x2c/0x40 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 00596576a051 ("mtd: core: clear out unregistered devices a bit more") Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> [<miquel.raynal@bootlin.com>: Light reword of the commit log] Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221119063915.11108-1-shangxiaojing@huawei.com
| * | mtd: parsers: refer to ARCH_BCMBCA instead of ARCH_BCM4908Lukas Bulwahn2022-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dd5c672d7ca9 ("arm64: bcmbca: Merge ARCH_BCM4908 to ARCH_BCMBCA") removes config ARCH_BCM4908 as config ARCH_BCMBCA has the same intent. Probably due to concurrent development, commit 002181f5b150 ("mtd: parsers: add Broadcom's U-Boot parser") introduces 'Broadcom's U-Boot partition parser' that depends on ARCH_BCM4908, but this use was not visible during the config refactoring from the commit above. Hence, these two changes create a reference to a non-existing config symbol. Adjust the MTD_BRCM_U_BOOT definition to refer to ARCH_BCMBCA instead of ARCH_BCM4908 to remove the reference to the non-existing config symbol ARCH_BCM4908. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221116124932.4748-1-lukas.bulwahn@gmail.com
| * | dt-bindings: mtd: Remove useless file about partitionsMiquel Raynal2022-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is already a real partitions.yaml file, so assuming everybody knows hot to read yaml schema now, this text file is no longer needed, so drop it. Depending on the situation, the lines referring to this file are either dropped or edited to point to mtd.yaml which includes partition{,s}.yaml. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/linux-mtd/20221114090315.848208-3-miquel.raynal@bootlin.com
| * | mtd: lpddr2_nvm: Fix possible null-ptr-derefHui Tang2022-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will cause null-ptr-deref when resource_size(add_range) invoked, if platform_get_resource() returns NULL. Fixes: 96ba9dd65788 ("mtd: lpddr: add driver for LPDDR2-NVM PCM memories") Signed-off-by: Hui Tang <tanghui20@huawei.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221114090240.244172-1-tanghui20@huawei.com
| * | mtd: inftlcore: fix repeated words in commentsJilin Yuan2022-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Delete the redundant word 'it'. Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221028134036.63000-1-yuanjilin@cdjrlc.com
| * | mtd: core: fix possible resource leak in init_mtd()Gaosheng Cui2022-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I got the error report while inject fault in init_mtd(): sysfs: cannot create duplicate filename '/devices/virtual/bdi/mtd-0' Call Trace: <TASK> dump_stack_lvl+0x67/0x83 sysfs_warn_dup+0x60/0x70 sysfs_create_dir_ns+0x109/0x120 kobject_add_internal+0xce/0x2f0 kobject_add+0x98/0x110 device_add+0x179/0xc00 device_create_groups_vargs+0xf4/0x100 device_create+0x7b/0xb0 bdi_register_va.part.13+0x58/0x2d0 bdi_register+0x9b/0xb0 init_mtd+0x62/0x171 [mtd] do_one_initcall+0x6c/0x3c0 do_init_module+0x58/0x222 load_module+0x268e/0x27d0 __do_sys_finit_module+0xd5/0x140 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> kobject_add_internal failed for mtd-0 with -EEXIST, don't try to register things with the same name in the same directory. Error registering mtd class or bdi: -17 If init_mtdchar() fails in init_mtd(), mtd_bdi will not be unregistered, as a result, we can't load the mtd module again, to fix this by calling bdi_unregister(mtd_bdi) after out_procfs label. Fixes: 445caaa20c4d ("mtd: Allocate bdi objects dynamically") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221024065109.2050705-1-cuigaosheng1@huawei.com
| * | mtd: core: set ROOT_DEV for partitions marked as rootfs in DTRafał Miłecki2022-11-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for "linux,rootfs" binding that is used to mark flash partition containing rootfs. It's useful for devices using device tree that don't have bootloader passing root info in cmdline. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221022211318.32009-2-zajec5@gmail.com
| * | mtd: Fix device name leak when register device failed in add_mtd_device()Zhang Xiaoxu2022-11-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a kmemleak when register device failed: unreferenced object 0xffff888101aab550 (size 8): comm "insmod", pid 3922, jiffies 4295277753 (age 925.408s) hex dump (first 8 bytes): 6d 74 64 30 00 88 ff ff mtd0.... backtrace: [<00000000bde26724>] __kmalloc_node_track_caller+0x4e/0x150 [<000000003c32b416>] kvasprintf+0xb0/0x130 [<000000001f7a8f15>] kobject_set_name_vargs+0x2f/0xb0 [<000000006e781163>] dev_set_name+0xab/0xe0 [<00000000e30d0c78>] add_mtd_device+0x4bb/0x700 [<00000000f3d34de7>] mtd_device_parse_register+0x2ac/0x3f0 [<00000000c0d88488>] 0xffffffffa0238457 [<00000000b40d0922>] 0xffffffffa02a008f [<0000000023d17b9d>] do_one_initcall+0x87/0x2a0 [<00000000770f6ca6>] do_init_module+0xdf/0x320 [<000000007b6768fe>] load_module+0x2f98/0x3330 [<00000000346bed5a>] __do_sys_finit_module+0x113/0x1b0 [<00000000674c2290>] do_syscall_64+0x35/0x80 [<000000004c6a8d97>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 If register device failed, should call put_device() to give up the reference. Fixes: 1f24b5a8ecbb ("[MTD] driver model updates") Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221022121352.2534682-1-zhangxiaoxu5@huawei.com
| * | mtd: remove lart flash driverArnd Bergmann2022-11-073-691/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The sa1100 lart platform was removed, so its flash driver is no longer useful. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221021155000.4108406-7-arnd@kernel.org
| * | mtd: parsers: tplink_safeloader: fix uninitialized variable bugDan Carpenter2022-11-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 64 bit systems, the highest 32 bits of the "offset" variable are not initialized. Also the existing code is not endian safe (it will fail on big endian systems). Change the type of "offset" to a u32. Fixes: aec4d5f5ffd0 ("mtd: parsers: add TP-Link SafeLoader partitions table parser") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/Y1gCALFWXYYwqV1P@kili
| * | mtd: parsers: add TP-Link SafeLoader partitions table parserRafał Miłecki2022-11-073-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This parser deals with most TP-Link home routers. It reads info about partitions and registers them in the MTD subsystem. Example from TP-Link Archer C5 V2: spi-nor spi0.0: s25fl128s1 (16384 Kbytes) 15 tplink-safeloader partitions found on MTD device spi0.0 Creating 15 MTD partitions on "spi0.0": 0x000000000000-0x000000040000 : "fs-uboot" 0x000000040000-0x000000440000 : "os-image" 0x000000440000-0x000000e40000 : "rootfs" 0x000000e40000-0x000000e40200 : "default-mac" 0x000000e40200-0x000000e40400 : "pin" 0x000000e40400-0x000000e40600 : "product-info" 0x000000e50000-0x000000e60000 : "partition-table" 0x000000e60000-0x000000e60200 : "soft-version" 0x000000e61000-0x000000e70000 : "support-list" 0x000000e70000-0x000000e80000 : "profile" 0x000000e80000-0x000000e90000 : "default-config" 0x000000e90000-0x000000ee0000 : "user-config" 0x000000ee0000-0x000000fe0000 : "log" 0x000000fe0000-0x000000ff0000 : "radio_bk" 0x000000ff0000-0x000001000000 : "radio" Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221015092950.27467-2-zajec5@gmail.com