From 50f3824528dd3a3097d8dd4d50b066b75eef63b3 Mon Sep 17 00:00:00 2001 From: Vladimir Bely Date: Fri, 27 Nov 2026 16:41:58 +0300 Subject: [PATCH 1/2] mtd: spinand: add Fudan Micro FM25S01A 1Gbit SPI NAND Add MFG_ID_FUDAN (0xA1) and Fudan Microelectronics FM25S01A (ID 0xA1 0xE4, 128 MiB / 1 Gbit, 2048 B page, 128 KiB eraseblock, 64 B OOB, 1-bit on-die ECC) to the Novatek SPI NAND driver, setting ecc.strength = 1 and bitflip_threshold = 1 in spinand_probe() so UBI scrubs single-bit flips. Tested on Dahua DH-IPC-HFW2449SP-S-IL (Novatek NT98566 / NA51089, 128 MB DDR3, Fudan FM25S01A 128 MiB SPI NAND ID 0xA1 0xE4, SC430AI). --- drivers/mtd/nvt_flash_spi/nvt_flash_spi_int.h | 1 + drivers/mtd/spiflash/spinand.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/mtd/nvt_flash_spi/nvt_flash_spi_int.h b/drivers/mtd/nvt_flash_spi/nvt_flash_spi_int.h index ca332fcf9bc..8d38966b482 100644 --- a/drivers/mtd/nvt_flash_spi/nvt_flash_spi_int.h +++ b/drivers/mtd/nvt_flash_spi/nvt_flash_spi_int.h @@ -282,6 +282,7 @@ struct drv_nand_dev_info { #define MFG_ID_TOSHIBA 0x98 #define MFG_ID_DOSILICON 0xE5 #define MFG_ID_XTX 0x0B +#define MFG_ID_FUDAN 0xA1 #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ diff --git a/drivers/mtd/spiflash/spinand.c b/drivers/mtd/spiflash/spinand.c index 41241b0b24a..798630760c0 100644 --- a/drivers/mtd/spiflash/spinand.c +++ b/drivers/mtd/spiflash/spinand.c @@ -427,6 +427,10 @@ static struct nand_flash_dev spinand_flash_ids[] = { {"GD5F4GQ4UAYIG 4GiB 3.3V", { .id = {MFG_ID_GD, 0xF4} }, SZ_2K, SZ_512, SZ_128K, 0, 2, 64 }, + // Fudan Micro + {"FM25S01A 1Gbit 3.3V", + { .id = {MFG_ID_FUDAN, 0xE4} }, + SZ_2K, SZ_128, SZ_128K, 0, 2, 64 }, }; #ifdef CONFIG_MTD_SPINAND_HWECC @@ -1390,6 +1394,9 @@ static int spinand_probe(struct platform_device *pdev) } else if (chip_id == MFG_ID_XTX) { info->nand_chip.ecc.strength = 8; mtd->bitflip_threshold = 6; + } else if (chip_id == MFG_ID_FUDAN) { + info->nand_chip.ecc.strength = 1; + mtd->bitflip_threshold = 1; } else { mtd->bitflip_threshold = DIV_ROUND_UP(info->nand_chip.ecc.strength * 3, 4); } From b6d67d8dd672dcce475a032fef54e9a5e015d986 Mon Sep 17 00:00:00 2001 From: Vladimir Bely Date: Fri, 27 Nov 2026 16:41:58 +0300 Subject: [PATCH 2/2] hwrng: nvt-rng: enable on NA51089 Allow CONFIG_HW_RANDOM_NVT on NVT_IVOT_PLAT_NA51089 (NT9856x). Tested on Dahua DH-IPC-HFW2449SP-S-IL (Novatek NT98566 / NA51089, 128 MB DDR3, Fudan FM25S01A 128 MiB SPI NAND ID 0xA1 0xE4, SC430AI). --- drivers/char/hw_random/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 4a5192a3dae..f6bc48cc3a1 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig @@ -386,7 +386,7 @@ config HW_RANDOM_CAVIUM config HW_RANDOM_NVT tristate "Novatek True Random Number Generator support" - depends on HW_RANDOM && NVT_IVOT_PLAT_NA51055 + depends on HW_RANDOM && (NVT_IVOT_PLAT_NA51055 || NVT_IVOT_PLAT_NA51089) default HW_RANDOM ---help--- This driver provides kernel-side support for the Random Number