diff --git a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/internals.h b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/internals.h index 109ed3e4e..892a3bd7f 100755 --- a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/internals.h +++ b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/internals.h @@ -34,6 +34,7 @@ #define NAND_MFR_TOSHIBA 0x98 #define NAND_MFR_WINBOND 0xef #define NAND_MFR_FUDAN 0xa1 +#define NAND_MFR_DOSIN 0xe5 /** * struct nand_manufacturer_ops - NAND Manufacturer operations diff --git a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_base.c b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_base.c index c41c0ff61..350f3517e 100644 --- a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_base.c +++ b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_base.c @@ -4603,7 +4603,12 @@ static bool find_full_id_nand(struct nand_chip *chip, memorg->oobsize = type->oobsize; mtd->oobsize = memorg->oobsize; - memorg->bits_per_cell = nand_get_bits_per_cell(id_data[2]); + /* Check if chip is forced to SLC */ + if (type->options & NAND_FORCE_SLC) { + memorg->bits_per_cell = 1; + } else { + memorg->bits_per_cell = nand_get_bits_per_cell(id_data[2]); + } memorg->eraseblocks_per_lun = DIV_ROUND_DOWN_ULL((u64)type->chipsize << 20, memorg->pagesize * diff --git a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_ids.c b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_ids.c index b18b61af5..c378bd312 100755 --- a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_ids.c +++ b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/drivers/mtd/nand/raw/nand_ids.c @@ -85,7 +85,10 @@ struct nand_flash_dev nand_flash_ids[] = { {"GD5F1GQ5X", { .id = {0xC8, 0x51} }, - SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(24, SZ_1K)}, + SZ_2K, SZ_128, SZ_128K, NAND_FORCE_SLC, 2, 128, NAND_ECC_INFO(24, SZ_1K)}, + {"GD5F1GM7X", + { .id = {0xC8, 0x91} }, + SZ_2K, SZ_128, SZ_128K, NAND_FORCE_SLC, 2, 128, NAND_ECC_INFO(24, SZ_1K)}, {"FM25S01A", { .id = {0xA1, 0xD4} }, SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(8, SZ_1K)}, @@ -95,6 +98,9 @@ struct nand_flash_dev nand_flash_ids[] = { {"XT26G01CWSIG 3.3V SPI", { .id = {0x0B, 0x11 } }, SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(8, SZ_1K)}, + {"DS35Q1GA 3.3V SPI", + { .id = {0xE5, 0x71 } }, + SZ_2K, SZ_128, SZ_128K, NAND_FORCE_SLC, 2, 64, NAND_ECC_INFO(8, SZ_1K)}, LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS), @@ -228,6 +234,7 @@ static const struct nand_manufacturer_desc nand_manufacturer_descs[] = { {NAND_MFR_TOSHIBA, "Toshiba", &toshiba_nand_manuf_ops}, {NAND_MFR_WINBOND, "Winbond"}, {NAND_MFR_FUDAN, "FUDAN"}, + {NAND_MFR_DOSIN, "DOSIN"}, }; /** diff --git a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/include/linux/mtd/rawnand.h b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/include/linux/mtd/rawnand.h index 4aeb83a91..828d6b8d1 100755 --- a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/include/linux/mtd/rawnand.h +++ b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/kernel/linux-5.10.y/include/linux/mtd/rawnand.h @@ -211,6 +211,12 @@ struct nand_chip; #define NAND_NO_BBM_QUIRK BIT(27) /* Cell info constants */ +/* + * Force treating this chip as SLC regardless of ID data. + * Some chips with short ID (id_len <= 2) may have unreliable cellinfo byte. + */ +#define NAND_FORCE_SLC BIT(28) + #define NAND_CI_CHIPNR_MSK 0x03 #define NAND_CI_CELLTYPE_MSK 0x0C #define NAND_CI_CELLTYPE_SHIFT 2 diff --git a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/uboot/uboot/drivers/mtd/nand/nand_ids.c b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/uboot/uboot/drivers/mtd/nand/nand_ids.c index cc0e2a1d0..06e99286a 100755 --- a/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/uboot/uboot/drivers/mtd/nand/nand_ids.c +++ b/sdk/X-AIOS-LT00-V1.0.4/base/soc/qm10xd/linux/bsp/uboot/uboot/drivers/mtd/nand/nand_ids.c @@ -115,10 +115,14 @@ struct nand_flash_dev nand_flash_ids[] = { SZ_2K, SZ_128, SZ_128K, 0, 2, 64, NAND_ECC_INFO(8, SZ_1K), 0 }, #endif - {"GD5F1GF5X 3.3V SPI", + {"GD5F1GQ5X 3.3V SPI", { .id = {0xC8, 0x51 } }, SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(24, SZ_1K), 0 }, + {"GD5F1GM7X 3.3V SPI", + { .id = {0xC8, 0x91 } }, + SZ_2K, SZ_128, SZ_128K, 0, 2, 128, NAND_ECC_INFO(24, SZ_1K), + 0 }, {"GD5F2GQ4U 3.3V SPI", { .id = {0xC8, 0xb2} }, SZ_2K, SZ_256, SZ_128K, 0, 2, 64, NAND_ECC_INFO(8, SZ_1K), diff --git a/sdk/X-AIOS-LT00-V1.0.4/tools/partition/qm10xd/los_spi-nand/demo_ld_nand/script.ini b/sdk/X-AIOS-LT00-V1.0.4/tools/partition/qm10xd/los_spi-nand/demo_ld_nand/script.ini index c6a957c35..57f05bbe3 100755 --- a/sdk/X-AIOS-LT00-V1.0.4/tools/partition/qm10xd/los_spi-nand/demo_ld_nand/script.ini +++ b/sdk/X-AIOS-LT00-V1.0.4/tools/partition/qm10xd/los_spi-nand/demo_ld_nand/script.ini @@ -3,8 +3,6 @@ DONE=yes REBOOT=yes CMD: env default -a; -qua_logo logo_update_1.jpg;fatload usb 0:1 40008000 u-boot-spl-header.img;nand erase.part boot-spl;nand write 40008000 boot-spl splfilesize; -qua_logo logo_update_1.jpg;fatload usb 0:1 40008000 u-boot.bin;nand erase.part boot-uboot;nand write 40008000 boot-uboot ubootfilesize; qua_logo logo_update_1.jpg;fatload usb 0:1 40008000 logo.img;nand erase.part logo;nand write 40008000 logo logofilesize; qua_logo logo_update_1.jpg;fatload usb 0:1 40008000 misc.img;nand erase.part misc;nand write 40008000 misc 1000; qua_logo logo_update_1.jpg;fatload usb 0:1 40008000 recovery.img;nand erase.part recovery;nand write 40008000 recovery recoveryfilesize; diff --git a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-sdl.bin b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-sdl.bin index aae997637..f43b83eb4 100755 Binary files a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-sdl.bin and b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-sdl.bin differ diff --git a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-spl-header.img b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-spl-header.img index 406d18ddd..ba3b01a34 100755 Binary files a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-spl-header.img and b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot-spl-header.img differ diff --git a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot.bin b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot.bin index a3259ee40..4eafede17 100755 Binary files a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot.bin and b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/u-boot.bin differ diff --git a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/zImage-dtb b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/zImage-dtb index 5695529c6..d90dffe21 100644 Binary files a/sdk/X-AIOS-LT00-V1.0.4/usb_burn/zImage-dtb and b/sdk/X-AIOS-LT00-V1.0.4/usb_burn/zImage-dtb differ