mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-09-11 15:29:40 +00:00
Add support for FudanMicro FM25S01A SPI NAND.
Datasheet: http://eng.fmsh.com/nvm/FM25S01A_ds_eng.pdf
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
[add lore.kernel.org link to the patch files]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19760
(cherry picked from commit a140bcbc7c
)
[drop patches for kernel 6.12, refresh patches]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19991
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
35 lines
808 B
Diff
35 lines
808 B
Diff
--- a/drivers/mtd/nand/spi/core.c
|
|
+++ b/drivers/mtd/nand/spi/core.c
|
|
@@ -19,6 +19,7 @@
|
|
#include <linux/string.h>
|
|
#include <linux/spi/spi.h>
|
|
#include <linux/spi/spi-mem.h>
|
|
+#include <linux/mtd/mtk_bmt.h>
|
|
|
|
static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
|
|
{
|
|
@@ -1352,6 +1353,7 @@ static int spinand_probe(struct spi_mem
|
|
if (ret)
|
|
return ret;
|
|
|
|
+ mtk_bmt_attach(mtd);
|
|
ret = mtd_device_register(mtd, NULL, 0);
|
|
if (ret)
|
|
goto err_spinand_cleanup;
|
|
@@ -1359,6 +1361,7 @@ static int spinand_probe(struct spi_mem
|
|
return 0;
|
|
|
|
err_spinand_cleanup:
|
|
+ mtk_bmt_detach(mtd);
|
|
spinand_cleanup(spinand);
|
|
|
|
return ret;
|
|
@@ -1377,6 +1380,7 @@ static int spinand_remove(struct spi_mem
|
|
if (ret)
|
|
return ret;
|
|
|
|
+ mtk_bmt_detach(mtd);
|
|
spinand_cleanup(spinand);
|
|
|
|
return 0;
|