| #include <common.h> |
| #include <environment.h> |
| #include <nand.h> |
| #include <asm/io.h> |
| #include <malloc.h> |
| #include <linux/err.h> |
| #include <asm/cache.h> |
| // #include <asm/reboot.h> |
| #include <asm/arch/clock.h> |
| #include <asm/cpu_id.h> |
| |
| #include "aml_mtd.h" |
| |
| extern struct hw_controller *controller; |
| |
| #if 0 |
| extern void test_timing(struct mtd_info *mtd, struct nand_chip *chip); |
| #endif |
| |
| int nand_fbb_issue_flag; |
| struct aml_nand_flash_dev aml_nand_flash_ids[] = { |
| {"B revision NAND 8GiB MT29F64G08CBABA", |
| {NAND_MFR_MICRON, 0x64, 0x44, 0x4B, 0xA9}, |
| 8192, |
| 8192, |
| 0x200000, |
| 744, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A revision NAND 2GiB H27UAG8T2A", |
| {NAND_MFR_HYNIX, 0xd5, 0x94, 0x25, 0x44, 0x41}, |
| 4096, |
| 2048, |
| 0x80000, |
| 224, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"A revision NAND 4GiB H27UBG8T2A", |
| {NAND_MFR_HYNIX, 0xd7, 0x94, 0x9a, 0x74, 0x42}, |
| 8192, |
| 4096, |
| 0x200000, |
| 448, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"B revision NAND 2GiB H27UAG8T2B", |
| {NAND_MFR_HYNIX, 0xd5, 0x94, 0x9a, 0x74, 0x42}, |
| 8192, |
| 2048, |
| 0x200000, |
| 448, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| #ifdef NEW_NAND_SUPPORT |
| {"B revision 26nm NAND 4GiB H27UBG8T2B", |
| {NAND_MFR_HYNIX, 0xd7, 0x94, 0xda, 0x74, 0xc3}, |
| 8192, |
| 4096, |
| 0x200000, |
| 640, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE)}, |
| |
| {"B revision 26nm NAND 8GiB H27UCG8T2M", |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xd2, 0x04, 0x43}, |
| 8192, |
| 8192, |
| 0x200000, |
| 448, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"C revision 20nm NAND 4GiB H27UBG8T2C", |
| {NAND_MFR_HYNIX, 0xd7, 0x94, 0x91, 0x60, 0x44}, |
| 8192, |
| 4096, |
| 0x200000, |
| 640, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE)}, |
| |
| {"A revision 20nm NAND 8GiB H27UCG8T2A", |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xda, 0x74, 0xc4}, |
| 8192, |
| 8192, |
| 0x200000, |
| 640, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"B revision 20nm NAND 8GiB H27UCG8T2B", |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xeb, 0x74, 0x44}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1280, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE)}, |
| |
| {"E revision 1ynm NAND 8GiB H27UCG8T2E", |
| {NAND_MFR_HYNIX, 0xde, 0x14, 0xa7, 0x42, 0x4a}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1664, |
| 1, |
| 16, |
| 15, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE)}, |
| #endif |
| |
| #ifdef NEW_NAND_SUPPORT |
| {"B revision NAND 8GiB MT29F64G08CBABA", |
| {NAND_MFR_MICRON, 0x64, 0x44, 0x4B, 0xA9}, |
| 8192, |
| 8192, |
| 0x200000, |
| 744, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"D revision NAND 4GiB MT29F32G08CBADA", |
| {NAND_MFR_MICRON, 0x44, 0x44, 0x4B, 0xA9}, |
| 8192, |
| 4096, |
| 0x200000, |
| 744, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"1 Generation NAND 8GiB JS29F64G08ACMF1", |
| {NAND_MFR_INTEL, 0x88, 0x24, 0x4b, 0xA9,0x84}, |
| 8192, |
| 8192, |
| 0x200000, |
| 448, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| #endif |
| {"SamSung NAND K9F4G08U0F 4Gb", |
| {NAND_MFR_SAMSUNG, 0xdc, 0x10, 0x95, 0x56}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"SamSung NAND k9f2g08u0d 2Gb", |
| {NAND_MFR_SAMSUNG, 0xda, 0x10, 0x95, 0x46}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"Dosilicon NAND FMND1GXXX3D 3.3V 1Gb", |
| {NAND_MFR_DOSILICON, 0xf1, 0x80, 0x95}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"Dosilicon NAND FMND1GXXX3D 1.8V 1Gb", |
| {NAND_MFR_DOSILICON, 0xa1, 0x80, 0x15}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 30, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"Dosilicon NAND FMND2GXXX3D 3.3V 2Gb", |
| {NAND_MFR_DOSILICON, 0xda, 0x90, 0x95, 0x46}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"Dosilicon NAND FMND2GXXX3D 1.8V 2Gb", |
| {NAND_MFR_DOSILICON, 0xaa, 0x90, 0x15, 0x46}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 30, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"ATO NAND AFND1G08U3 1Gb", |
| {NAND_MFR_ATO, 0xf1, 0x00, 0x1d}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| {"A revision NAND 1GiB sF1G-A", |
| {NAND_MFR_AMD, 0xf1, 0x80, 0x1d, 0x01,0xf1}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE )}, |
| |
| {"A revision NAND 1GiB sF1G-A", |
| {NAND_MFR_AMD, 0xf1, 0x0, 0x1d, 0x01,0xf1}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"AMD/Spansion Slc NAND 2Gib S34ML02G1(MLO2G100BH1OO)", |
| {NAND_MFR_AMD, 0xda, 0x90, 0x95, 0x44, 0x01}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"AMD/Spansion Slc NAND 2Gib S34ML02G1(MLO2G200BH1OO)", |
| {NAND_MFR_AMD, 0xda, 0x90, 0x95, 0x46, 0x01}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"AMD/Spansion Slc NAND 8Gib S34ML08G1", |
| {NAND_MFR_AMD, 0xd3, 0xd1, 0x95, 0x58}, |
| 2048, |
| 1024, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 1Gib W29N01HV ", |
| {NAND_ID_WINBOND, 0xf1, 0x00, 0x95, 0x00, 0x00}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 4Gib W29N04GV ", |
| {NAND_ID_WINBOND, 0xdc, 0x90, 0x95, 0x54, 0x00}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"A revision NAND 1Gib W29N01GV ", |
| {NAND_ID_WINBOND, 0xf1, 0x80, 0x95, 0x00, 0x00}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 2Gib W29N02GV ", |
| {NAND_ID_WINBOND, 0xda, 0x90, 0x95, 0x04, 0x00}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 1GiB H27U1G8F2CTR ", |
| {NAND_MFR_HYNIX, 0xf1, 0x80, 0x1d, 0xad, 0xf1}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 4Gib EMST ", |
| {NAND_ID_ESMT, 0xac, 0x90, 0x15, 0x54, 0x7f}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 4Gib GD9FU1G8F2AMGI", |
| {NAND_ID_ESMT, 0xf1, 0x80, 0x1d, 0x42, 0xc8}, |
| 2048, |
| 128, |
| 0x20000, |
| 128, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"ESMT SLC 256MiB 3.3V 8-bit", |
| {NAND_ID_ESMT, 0xda, 0x90, 0x95, 0x44, 0x7f}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"ESMT SLC 128MiB 3.3V 8-bit F59L1G81Lxxx", |
| {NAND_ID_ESMT, 0xd1, 0x80, 0x95, 0x42, 0x7f}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"ESMT SLC 128MiB 3.3V 8-bit F59L1G81Mxxx", |
| {NAND_ID_ESMT, 0xd1, 0x80, 0x95, 0x40, 0x7f}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"A revision NAND 2Gib TC58BVG1S3HTA00 ", |
| {NAND_MFR_TOSHIBA, 0xda, 0x90, 0x15, 0xF6}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"A revision NAND 2Gib TC58NVG1S3HBAI4 ", |
| {NAND_MFR_TOSHIBA, 0xda, 0x90, 0x15, 0x76}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"A revision NAND 4Gib TH58NVG2S3HTA00 ", |
| {NAND_MFR_TOSHIBA, 0xdc, 0x91, 0x15, 0x76}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 35, /* trc = 50, 20MHz max ! */ |
| 10, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"A revision NAND 4Gib TC58NVG2S0HTA00 ", |
| {NAND_MFR_TOSHIBA, 0xdc, 0x90, 0x26, 0x76}, |
| 4096, |
| 512, |
| 0x40000, |
| 256, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"A revision NAND 4Gib TC58BVG2S0HTA00 ", |
| {NAND_MFR_TOSHIBA, 0xdc, 0x90, 0x26, 0xF6}, |
| 4096, |
| 512, |
| 0x40000, |
| 128, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"Slc NAND 1Gib MX30LF1G18AC ", |
| {NAND_MFR_MACRONIX, 0xf1, 0x80, 0x95, 0x02}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| {"Slc NAND 2Gib MX30LF2G18AC ", |
| {NAND_MFR_MACRONIX, 0xda, 0x90, 0x95, 0x06}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"Slc NAND 4Gib MX30LF4G18AC ", |
| {NAND_MFR_MACRONIX, 0xdc, 0x90, 0x95, 0x56}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 128MB TC58NVG0S3HTA00 ", |
| {NAND_MFR_TOSHIBA, 0xf1, 0x80, 0x15, 0x72}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"4Gib MT29F4G08ABAEA", |
| {NAND_MFR_MICRON, 0xdc, 0x90, 0xA6, 0x54}, |
| 4096, |
| 512, |
| 0x40000, |
| 224, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"4Gib MT29F4G08ABADA", |
| {NAND_MFR_MICRON, 0xdc, 0x90, 0x95, 0x56}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"A revision NAND 2Gib MT29F2G08-A", |
| {NAND_MFR_MICRON, 0xda, 0x90, 0x95, 0x06}, |
| 2048, |
| 256, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE )}, |
| |
| {"A revision NAND 1GiB MT29F1G-A", |
| {NAND_MFR_MICRON, 0xf1, 0x80, 0x95, 0x04}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE )}, |
| |
| {"A revision NAND 2GiB MT29F16G08ABABA", |
| {NAND_MFR_MICRON, 0x48, 0x00, 0x26, 0x89}, |
| 4096, |
| 2048, |
| 0x80000, |
| 224, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE4 | NAND_ECC_BCH8_MODE)}, |
| |
| {"A revision NAND 4GiB MT29F32G-A", |
| {NAND_MFR_MICRON, 0xd7, 0x94, 0x3e, 0x84}, |
| 4096, |
| 4096, |
| 0x80000, |
| 218, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"A revision NAND 16GiB MT29F128G-A", |
| {NAND_MFR_MICRON, 0xd9, 0xd5, 0x3e, 0x88}, |
| 4096, |
| 16384, |
| 0x80000, |
| 218, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"B revision NAND 4GiB MT29F32G-B", |
| {NAND_MFR_MICRON, 0x68, 0x04, 0x46, 0x89}, |
| 4096, |
| 4096, |
| 0x100000, |
| 224, |
| 1, |
| 20, |
| 15, |
| 4, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"B revision NAND 8GiB MT29F64G-B", |
| {NAND_MFR_MICRON, 0x88, 0x05, 0xc6, 0x89}, |
| 4096, |
| 8192, |
| 0x100000, |
| 224, |
| 1, |
| 20, |
| 15, |
| 4, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"C revision NAND 4GiB MT29F32G-C", |
| {NAND_MFR_MICRON, 0x68, 0x04, 0x4a, 0xa9}, |
| 4096, |
| 4096, |
| 0x100000, |
| 224, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"C revision NAND 8GiB MT29F64G-C", |
| {NAND_MFR_MICRON, 0x88, 0x04, 0x4b, 0xa9}, |
| 8192, |
| 8192, |
| 0x200000, |
| 448, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"C revision NAND 1GiB MT29F8G08ABABA", |
| {NAND_MFR_MICRON, 0x38, 0x00, 0x26, 0x85}, |
| 4096, |
| 1024, |
| 0x80000, |
| 224, |
| 1, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| |NAND_TWO_PLANE_MODE)}, |
| |
| {"C revision NAND 32GiB MT29F256G-C", |
| {NAND_MFR_MICRON, 0xa8, 0x05, 0xcb, 0xa9}, |
| 8192, |
| 16384, |
| 0x200000, |
| 448, |
| 2, |
| 16, |
| 15, |
| 5, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE | NAND_INTERLEAVING_MODE)}, |
| |
| {"1 Generation NAND 4GiB JS29F32G08AA-1", |
| {NAND_MFR_INTEL, 0x68, 0x04, 0x46, 0xA9}, |
| 4096, |
| 4096, |
| 0x100000, |
| 218, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"1 Generation NAND 8GiB JS29F64G08AA-1", |
| {NAND_MFR_INTEL, 0x88, 0x24, 0x4b, 0xA9}, |
| 8192, |
| 8192, |
| 0x200000, |
| 448, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"E serials NAND 2GiB TC58NVG4D2ETA00", |
| {NAND_MFR_TOSHIBA, 0xD5, 0x94, 0x32, 0x76, 0x54}, |
| 8192, |
| 2048, |
| 0x100000, |
| 376, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"E serials NAND 4GiB TC58NVG5D2ETA00", |
| {NAND_MFR_TOSHIBA, 0xD7, 0x94, 0x32, 0x76, 0x54}, |
| 8192, |
| 4096, |
| 0x100000, |
| 376, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"F serials NAND 2GiB TC58NVG4D2FTA00", |
| {NAND_MFR_TOSHIBA, 0xD5, 0x94, 0x32, 0x76, 0x55}, |
| 8192, |
| 2076, |
| 0x100000, |
| 448, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"F serials NAND 4GiB TC58NVG5D2FTA00", |
| {NAND_MFR_TOSHIBA, 0xD7, 0x94, 0x32, 0x76, 0x55}, |
| 8192, |
| 4096, |
| 0x100000, |
| 448, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"F serials NAND 8GiB TC58NVG6D2FTA00", |
| {NAND_MFR_TOSHIBA, 0xDE, 0x94, 0x32, 0x76, 0x55}, |
| 8192, |
| 8192, |
| 0x100000, |
| 448, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"F serials NAND 8GiB TH58NVG7D2FTA20", |
| {NAND_MFR_TOSHIBA, 0xDE, 0x95, 0x32, 0x7a, 0x55}, |
| 8192, |
| 8200, |
| 0x100000, |
| 448, |
| 2, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE | NAND_INTERLEAVING_MODE)}, |
| |
| #ifdef NEW_NAND_SUPPORT |
| {"F serials NAND 4GiB TC58NVG5D2HTA00", |
| {NAND_MFR_TOSHIBA, 0xD7, 0x94, 0x32, 0x76, 0x56}, |
| 8192, |
| 4096, |
| 0x100000, |
| 640, |
| 1, |
| 20, |
| 25, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"F serials NAND 8GiB TC58NVG6D2GTA00", |
| {NAND_MFR_TOSHIBA, 0xDE, 0x94, 0x82, 0x76, 0x56}, |
| 8192, |
| 8192, |
| 0x200000, |
| 640, |
| 1, |
| 20, |
| 25, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"F serials NAND 8GiB TC58TEG6DCJTA00", |
| {NAND_MFR_TOSHIBA, 0xDE, 0x84, 0x93, 0x72, 0x57}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1280, |
| 1, |
| 20, |
| 25, |
| 0, |
| /*need readretry, disable two plane mode*/ |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 4GiB TC58TEG5DCJTA00 ", |
| {NAND_MFR_TOSHIBA, 0xD7, 0x84, 0x93, 0x72, 0x57}, |
| 16384, |
| 4096, |
| 0x400000, |
| 1280, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 8GiB TC58TEG6DDKTA00 ", |
| {NAND_MFR_TOSHIBA, |
| 0xDE, |
| 0x94, |
| 0x93, |
| 0x76, |
| 0x50}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1280, |
| 1, |
| 16, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 16GiB TC58TEG7DCJTA00 ", |
| {NAND_MFR_TOSHIBA, 0x3a, 0x85, 0x93, 0x76, 0x57}, |
| 16384, |
| 16384, |
| 0x400000, |
| 1280, |
| 2, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| #endif |
| #ifdef NEW_NAND_SUPPORT |
| {"A serials NAND 8GiB SDTNQGAMA-008G ", |
| {NAND_MFR_SANDISK, 0xDE, 0x94, 0x93, 0x76, 0x57}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1280, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 4GiB SDTNQGAMA-004G ", |
| {NAND_MFR_SANDISK, 0xD7, 0x84, 0x93, 0x72, 0x57}, |
| 16384, |
| 4096, |
| 0x400000, |
| 1280, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 8GiB SDTNPMAHEM-008G ", |
| {NAND_MFR_SANDISK, 0xDE, 0xA4, 0x82, 0x76, 0x56}, |
| 8192, |
| 8192, |
| 0x200000, |
| 640, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"A serials NAND 8GiB SDTNRGAMA-008G ", |
| {NAND_MFR_SANDISK, 0xDE, 0x94, 0x93, 0x76, 0x50}, |
| 16384, |
| 8192, |
| 0x400000, |
| 1280, |
| 1, |
| 20, |
| 25, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| #endif |
| {"M Generation NAND 4Gib K9F4G08U0D", |
| {NAND_MFR_SAMSUNG, 0xDC, 0x10, 0x95, 0x54,0XEC,}, |
| 2048, |
| 512, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"M Generation NAND 1Gib FS33ND01GS108TFI0", |
| {NAND_MFR_SAMSUNG, 0xF1, 0x00, 0x95, 0x42}, |
| 2048, |
| 128, |
| 0x20000, |
| 64, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"M Generation NAND 2GiB K9GAG08U0M", |
| {NAND_MFR_SAMSUNG, 0xD5, 0x14, 0xb6, 0x74}, |
| 4096, |
| 2048, |
| 0x80000, |
| 128, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH8_MODE)}, |
| |
| {"5 Generation NAND 2GiB K9GAG08X0D", |
| {NAND_MFR_SAMSUNG, 0xD5, 0x94, 0x29, 0x34, 0x41}, |
| 4096, |
| 2048, |
| 0x80000, |
| 218, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"6 Generation NAND 2GiB K9GAG08U0E", |
| {NAND_MFR_SAMSUNG, 0xD5, 0x84, 0x72, 0x50, 0x42}, |
| 8192, |
| 2048, |
| 0x100000, |
| 436, |
| 1, |
| 25, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE)}, |
| |
| {"7 Generation NAND 2GiB K9GAG08U0F", |
| {NAND_MFR_SAMSUNG, 0xD5, 0x94, 0x76, 0x54, 0x43}, |
| 8192, |
| 2048, |
| 0x100000, |
| 512, |
| 1, |
| 25, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"6 Generation NAND 4GiB K9LBG08U0E", |
| {NAND_MFR_SAMSUNG, 0xD7, 0xC5, 0x72, 0x54, 0x42}, |
| 8192, |
| 4096, |
| 0x100000, |
| 436, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"6 Generation NAND 8GiB K9HCG08U0E", |
| {NAND_MFR_SAMSUNG, 0xDE, 0xC5, 0x72, 0x54, 0x42}, |
| 8192, |
| 8192, |
| 0x100000, |
| 436, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH12_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"2 Generation NAND 4GiB K9GBG08U0A", |
| {NAND_MFR_SAMSUNG, 0xD7, 0x94, 0x7a, 0x54, 0x43}, |
| 8192, |
| 4152, |
| 0x100000, |
| 640, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE)}, |
| |
| {"2 Generation NAND 8GiB K9LCG08U0A", |
| {NAND_MFR_SAMSUNG, 0xDE, 0xD5, 0x7a, 0x58, 0x43}, |
| 8192, |
| 8304, |
| 0x100000, |
| 640, |
| 2, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE |
| | NAND_TWO_PLANE_MODE | NAND_INTERLEAVING_MODE)}, |
| |
| #ifdef NEW_NAND_SUPPORT |
| {"2 Generation NAND 4GiB K9GBG08U0B", |
| {NAND_MFR_SAMSUNG, 0xD7, 0x94, 0x7e, 0x64, 0x44}, |
| 8192, |
| 4096, |
| 0x100000, |
| 640, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| |
| {"2 Generation NAND 8GiB K9LCG08U0B", |
| {NAND_MFR_SAMSUNG, 0xDE, 0xD5, 0x7e, 0x68, 0x44}, |
| 8192, |
| 8192, |
| 0x100000, |
| 640, |
| 1, |
| 20, |
| 15, |
| 0, |
| (NAND_TIMING_MODE5 | NAND_ECC_BCH16_MODE )}, |
| #endif |
| {NULL,} |
| }; |
| |
| int aml_nand_get_fbb_issue(void) |
| { |
| return nand_fbb_issue_flag; |
| } |
| |
| void aml_nand_check_fbb_issue(u8 *dev_id) |
| { |
| int i, k; |
| u8 samsung_nand_id[][MAX_ID_LEN] = { |
| {NAND_MFR_SAMSUNG, 0xdc, 0x10, 0x95, 0x56}, |
| {NAND_MFR_SAMSUNG, 0xda, 0x10, 0x95, 0x46}, |
| }; |
| |
| k = ARRAY_SIZE(samsung_nand_id); |
| for (i = 0; i < k; i++) { |
| if (!strncmp((char *)samsung_nand_id[i], (char *)dev_id, |
| strlen((const char *)samsung_nand_id[i]))) |
| nand_fbb_issue_flag = 1; |
| } |
| } |
| |
| //******************** |
| #ifdef CONFIG_PARAMETER_PAGE |
| struct parameter_page para_page; |
| |
| void aml_nand_read_parameter_page(struct mtd_info *mtd, int ce, char * buf) |
| { |
| |
| struct nand_chip *chip = mtd->priv; |
| |
| NFC_SEND_CMD(ce | CLE | 0xec); |
| NFC_SEND_CMD(ce | ALE | 0x00); |
| NFC_SEND_CMD(ce | IDLE | 5); |
| |
| signed long i,count; |
| memset(buf,0,256); |
| for (i=0,count=0;i<256 && count<256;i++) |
| { |
| *buf=chip->read_byte(mtd); |
| if ((0 == i) && (0x4f != *buf)) |
| { |
| i=-1; |
| count++; |
| continue; |
| } |
| |
| buf++; |
| } |
| } |
| |
| void display_para_page(struct parameter_page para_page,unsigned long log_level) |
| { |
| unsigned long i; |
| signed long j; |
| unsigned char* buf = (unsigned char*)¶_page; |
| |
| printk("\nNand parameter page: \n"); |
| |
| if ((para_page.signature[0] != 0x4f) |
| || (para_page.signature[1] != 0x4e) |
| || (para_page.signature[2] != 0x46) |
| || (para_page.signature[3] != 0x49)) { |
| printk("Wrong parameter page reading.\n"); |
| return; |
| } |
| |
| if (1 == log_level) { |
| printk("The parameter value is show as following list," |
| "please refer to ONFI SPEC for more infomation.\n"); |
| printk("index val index val index val index val "); |
| for (i = 0; i < sizeof(para_page); i++, buf++) { |
| if (!(i % 4)) |
| printf("\n"); |
| if (0 == i) |
| printk("0~31 byte:Revision info and features blk:\n"); |
| else if(32 == i) |
| printk("32~79 byte: Manufacturer info blk:\n"); |
| else if(80 == i) |
| printk("80~127 byte: Memory organization blk:\n"); |
| else if(128 == i) |
| printk("128~163 byte: Electrical parameters block:\n"); |
| else if(164 == i) |
| printk("164~255 byte: Vendor block:\n"); |
| printk("%03d 0x%02x ",i, *buf); |
| |
| } |
| } else { |
| printk("Manu info: "); |
| for (j=0; j<12; j++) |
| printk("%c", para_page.dev_manu[j]); |
| printk("\n"); |
| |
| printk("ONFI v"); |
| if (para_page.ver & 0x40) |
| printk("3.0 "); |
| if (para_page.ver & 0x20) |
| printk("2.3 "); |
| if (para_page.ver & 0x10) |
| printk("2.2 "); |
| if (para_page.ver & 0x08) |
| printk("2.1 "); |
| if (para_page.ver & 0x04) |
| printk("2.0 "); |
| if (para_page.ver & 0x02) |
| printk("1.0"); |
| printk("\n"); |
| |
| printk("Feature supprot: 0x%x\n",para_page.feature); |
| |
| printk("%d bytes per page.\n",para_page.data_bytes_perpage); |
| printk("%d spare bytes per page.\n", |
| para_page.spare_bytes_perpage); |
| printk("%d pages per block.\n",para_page.pages_perblk); |
| printk("%d blocks per LUN.\n",para_page.blks_perLUN); |
| printk("%d LUNs.\n",para_page.num_LUN); |
| para_page.num_addr_cycle; |
| printk("Column address cycles %d, Row address cycles %d.\n", |
| para_page.num_addr_cycle & 0xf0, |
| para_page.num_addr_cycle & 0xf); |
| printk("%d bits per cell.\n",para_page.bits_percell); |
| |
| printk("Bad blocks maximum per LUN: %d\n", |
| para_page.max_badblk_perLUN); |
| printk("%d bits ECC correctability.\n", |
| para_page.bits_ECC_corretable); |
| |
| printk("Support time mode: "); |
| for (j = 5; j >= 0; j--) { |
| if (para_page.asy_time_mode & (1<<j)) |
| printk("%d ",j); |
| } |
| } |
| printk("\nEnd of Nand parameter page.\n\n"); |
| return; |
| } |
| #endif //CONFIG_PARAMETER_PAGE |
| |
| |
| //******************* |
| uint8_t aml_nand_get_onfi_features(struct aml_nand_chip *aml_chip, |
| uint8_t *buf, int addr) |
| { |
| struct nand_chip *chip = &aml_chip->chip; |
| struct mtd_info *mtd = &aml_chip->mtd; |
| int i, j; |
| |
| for (i=0; i<controller->chip_num; i++) { |
| if (aml_chip->valid_chip[i]) { |
| aml_chip->aml_nand_select_chip(aml_chip, i); |
| aml_chip->aml_nand_command(aml_chip, |
| NAND_CMD_GET_FEATURES, -1, -1, i); |
| chip->cmd_ctrl(mtd, addr, |
| NAND_CTRL_CHANGE | NAND_NCE | NAND_ALE); |
| NFC_SEND_CMD_IDLE(controller, 20); |
| for (j = 0; j < 4; j++) |
| buf[j] = chip->read_byte(mtd); |
| } |
| } |
| return 0; |
| } |
| |
| void aml_nand_set_onfi_features(struct aml_nand_chip *aml_chip, |
| uint8_t *buf, int addr) |
| { |
| int i, j; |
| struct nand_chip *chip = &aml_chip->chip; |
| struct mtd_info *mtd = &aml_chip->mtd; |
| for (i=0; i<controller->chip_num; i++) { |
| if (aml_chip->valid_chip[i]) { |
| aml_chip->aml_nand_select_chip(aml_chip, i); |
| aml_chip->aml_nand_command(aml_chip, |
| NAND_CMD_SET_FEATURES, -1, -1, i); |
| chip->cmd_ctrl(mtd, addr, |
| NAND_CTRL_CHANGE | NAND_NCE | NAND_ALE); |
| NFC_SEND_CMD_IDLE(controller, 20); |
| for (j=0; j<4; j++) |
| aml_chip->aml_nand_write_byte(aml_chip, buf[j]); |
| aml_chip->aml_nand_wait_devready(aml_chip, i); |
| } |
| } |
| } |
| |
| static struct aml_nand_flash_dev *aml_nand_get_flash_type(struct mtd_info *mtd, |
| struct nand_chip *chip, |
| int busw, int *maf_id) |
| { |
| struct aml_nand_chip *aml_chip = mtd_to_nand_chip(mtd); |
| struct aml_nand_platform *plat = aml_chip->platform; |
| struct aml_nand_flash_dev *type = NULL; |
| int i, maf_idx; |
| u8 dev_id[MAX_ID_LEN]; |
| |
| #ifdef NEW_NAND_SUPPORT |
| struct new_tech_nand_t *nand_info; |
| nand_info = &aml_chip->new_nand_info; |
| u8 dev_id_hynix_26nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xd2, 0x04, 0x43}; |
| u8 dev_id_hynix_26nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xd7, 0x94, 0xda, 0x74, 0xc3}; |
| u8 dev_id_hynix_20nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xd7, 0x94, 0x91, 0x60, 0x44}; |
| u8 dev_id_hynix_20nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xda, 0x74, 0xc4}; |
| u8 dev_id_hynix_20nm_lga_8g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xde, 0x94, 0xeb, 0x74, 0x44}; |
| u8 dev_id_hynix_1ynm_8g[MAX_ID_LEN] = |
| {NAND_MFR_HYNIX, 0xde, 0x14, 0xa7, 0x42, 0x4a}; |
| u8 dev_id_toshiba_24nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xD7, 0x94, 0x32, 0x76, 0x56}; |
| u8 dev_id_toshiba_24nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xDE, 0x94, 0x82, 0x76, 0x56}; |
| u8 dev_id_toshiba_19nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xDE, 0x84, 0x93, 0x72, 0x57}; |
| u8 dev_id_toshiba_19nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xD7, 0x84, 0x93, 0x72, 0x57}; |
| u8 dev_id_toshiba_a19nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xDe, 0x94, 0x93, 0x76, 0x50}; |
| u8 dev_id_toshiba_a19nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xD7, 0x84, 0x93, 0x72, 0x50}; |
| u8 dev_id_toshiba_19nm_16g[MAX_ID_LEN] = |
| {NAND_MFR_TOSHIBA, 0xa3, 0x85, 0x93, 0x76, 0x57}; |
| u8 dev_id_samsung_2xnm_8g[MAX_ID_LEN] = |
| {NAND_MFR_SAMSUNG, 0xDE, 0xD5, 0x7E, 0x68, 0x44}; |
| u8 dev_id_samsung_2xnm_4g[MAX_ID_LEN] = |
| {NAND_MFR_SAMSUNG, 0xD7, 0x94, 0x7e, 0x64, 0x44}; |
| u8 dev_id_sandisk_19nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_SANDISK, 0xDE, 0x94, 0x93, 0x76, 0x57}; |
| u8 dev_id_sandisk_19nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_SANDISK, 0xD7, 0x84, 0x93, 0x72, 0x57}; |
| u8 dev_id_sandisk_24nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_SANDISK, 0xDE, 0xA4, 0x82, 0x76, 0x56}; |
| u8 dev_id_sandisk_a19nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_SANDISK, 0xDE, 0x94, 0x93, 0x76, 0x50}; |
| u8 dev_id_sandisk_a19nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_SANDISK, 0xD7, 0x84, 0x93, 0x72, 0x50}; |
| u8 dev_id_micron_20nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_MICRON, 0x64, 0x44, 0x4B, 0xA9}; |
| u8 dev_id_micron_20nm_4g[MAX_ID_LEN] = |
| {NAND_MFR_MICRON, 0x44, 0x44, 0x4B, 0xA9}; |
| u8 dev_id_intel_20nm_8g[MAX_ID_LEN] = |
| {NAND_MFR_INTEL, 0x88, 0x24, 0x4B, 0xA9,0x84}; |
| #endif |
| //int tmp_id, tmp_manf; |
| |
| /* Send the command for reading device ID */ |
| chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1); |
| |
| /* Read manufacturer and device IDs */ |
| for (i=0; i<MAX_ID_LEN; i++) { |
| dev_id[i] = chip->read_byte(mtd); |
| } |
| *maf_id = dev_id[0]; |
| printk("NAND device id: %x %x %x %x %x %x \n", |
| dev_id[0], dev_id[1], dev_id[2], dev_id[3], dev_id[4], dev_id[5]); |
| |
| #if 0 |
| test_timing(mtd, chip); |
| #endif |
| /* Lookup the flash id */ |
| for (i = 0; aml_nand_flash_ids[i].name != NULL; i++) { |
| if (!strncmp((char*) aml_nand_flash_ids[i].id, |
| (char*)dev_id, strlen((const char*)aml_nand_flash_ids[i].id))) { |
| type = &aml_nand_flash_ids[i]; |
| break; |
| } |
| } |
| |
| if (!type) { |
| if (plat->nand_flash_dev) { |
| if (!strncmp((char*) plat->nand_flash_dev->id, |
| (char*)dev_id, strlen((const char*)plat->nand_flash_dev->id))) |
| type = plat->nand_flash_dev; |
| } |
| |
| if (!type) |
| return ERR_PTR(-ENODEV); |
| } |
| aml_nand_check_fbb_issue(dev_id); |
| |
| #ifdef NEW_NAND_SUPPORT |
| memset(nand_info, 0, sizeof(struct new_tech_nand_t)); |
| if (!strncmp((char*)type->id, (char*) dev_id_hynix_26nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info.type = HYNIX_26NM_8GB; |
| aml_chip->ran_mode = 1; |
| printk("aml_chip->hynix_new_nand_type =: %d \n", |
| nand_info->type); |
| |
| //read retry |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 6; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0xAC; |
| nand_info->read_rety_info.reg_addr[1] = 0xAD; |
| nand_info->read_rety_info.reg_addr[2] = 0xAE; |
| nand_info->read_rety_info.reg_addr[3] = 0xAF; |
| |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0x06; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0x06; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = -0x03; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = -0x07; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = -0x08; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = -0x06; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = -0x0D; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = -0x0F; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = -0x0B; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = -0x14; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = -0x17; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = -0x1A; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = -0x1E; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = -0x20; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = -0x25; |
| |
| nand_info->slc_program_info.reg_cnt = 5; |
| |
| nand_info->slc_program_info.reg_addr[0] = 0xA4; |
| nand_info->slc_program_info.reg_addr[1] = 0xA5; |
| nand_info->slc_program_info.reg_addr[2] = 0xB0; |
| nand_info->slc_program_info.reg_addr[3] = 0xB1; |
| nand_info->slc_program_info.reg_addr[4] = 0xC9; |
| |
| nand_info->slc_program_info.reg_offset_value[0] = 0x25; |
| nand_info->slc_program_info.reg_offset_value[1] = 0x25; |
| nand_info->slc_program_info.reg_offset_value[2] = 0x25; |
| nand_info->slc_program_info.reg_offset_value[3] = 0x25; |
| nand_info->slc_program_info.reg_offset_value[4] = 0x01; |
| |
| nand_info->read_rety_info.get_default_value = |
| aml_nand_get_read_default_value_hynix; |
| nand_info->read_rety_info.save_default_value = |
| aml_nand_save_read_default_value_hynix; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_hynix; |
| |
| nand_info->slc_program_info.enter_enslc_mode = |
| aml_nand_enter_enslc_mode_hynix; |
| nand_info->slc_program_info.exit_enslc_mode = |
| aml_nand_exit_enslc_mode_hynix; |
| nand_info->slc_program_info.get_default_value = |
| aml_nand_get_slc_default_value_hynix; |
| } else if(!strncmp((char*)type->id, (char*)dev_id_hynix_26nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info->type = HYNIX_26NM_4GB; |
| aml_chip->ran_mode = 1; |
| printk("aml_chip->hynix_new_nand_type =: %d \n", nand_info->type); |
| |
| //read retry |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 6; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0xA7; |
| nand_info->read_rety_info.reg_addr[1] = 0xAD; |
| nand_info->read_rety_info.reg_addr[2] = 0xAE; |
| nand_info->read_rety_info.reg_addr[3] = 0xAF; |
| |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0x06; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0x06; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = -0x03; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = -0x07; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = -0x08; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = -0x06; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = -0x0D; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = -0x0F; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = -0x09; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = -0x14; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = -0x17; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = -0x1A; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = -0x1E; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = |
| READ_RETRY_ZERO; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = -0x20; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = -0x25; |
| |
| nand_info->slc_program_info.reg_cnt = 5; |
| |
| nand_info->slc_program_info.reg_addr[0] = 0xA0; |
| nand_info->slc_program_info.reg_addr[1] = 0xA1; |
| nand_info->slc_program_info.reg_addr[2] = 0xB0; |
| nand_info->slc_program_info.reg_addr[3] = 0xB1; |
| nand_info->slc_program_info.reg_addr[4] = 0xC9; |
| |
| nand_info->slc_program_info.reg_offset_value[0] = 0x26; |
| nand_info->slc_program_info.reg_offset_value[1] = 0x26; |
| nand_info->slc_program_info.reg_offset_value[2] = 0x26; |
| nand_info->slc_program_info.reg_offset_value[3] = 0x26; |
| nand_info->slc_program_info.reg_offset_value[4] = 0x01; |
| |
| nand_info->read_rety_info.get_default_value = |
| aml_nand_get_read_default_value_hynix; |
| nand_info->read_rety_info.save_default_value = |
| aml_nand_save_read_default_value_hynix; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_hynix; |
| |
| nand_info->slc_program_info.enter_enslc_mode = |
| aml_nand_enter_enslc_mode_hynix; |
| nand_info->slc_program_info.exit_enslc_mode = |
| aml_nand_exit_enslc_mode_hynix; |
| nand_info->slc_program_info.get_default_value = |
| aml_nand_get_slc_default_value_hynix; |
| |
| } |
| else if(!strncmp((char*)type->id, (char*)dev_id_hynix_20nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info->type = HYNIX_20NM_8GB; |
| aml_chip->ran_mode = 1; |
| printk("aml_chip->hynix_new_nand_type =: %d \n", |
| nand_info->type); |
| |
| //read retry |
| nand_info->read_rety_info.reg_cnt = 8; |
| nand_info->read_rety_info.retry_cnt = 7; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0xCC; |
| nand_info->read_rety_info.reg_addr[1] = 0xBF; |
| nand_info->read_rety_info.reg_addr[2] = 0xAA; |
| nand_info->read_rety_info.reg_addr[3] = 0xAB; |
| nand_info->read_rety_info.reg_addr[4] = 0xCD; |
| nand_info->read_rety_info.reg_addr[5] = 0xAD; |
| nand_info->read_rety_info.reg_addr[6] = 0xAE; |
| nand_info->read_rety_info.reg_addr[7] = 0xAF; |
| |
| nand_info->slc_program_info.reg_cnt = 4; |
| |
| nand_info->slc_program_info.reg_addr[0] = 0xB0; |
| nand_info->slc_program_info.reg_addr[1] = 0xB1; |
| nand_info->slc_program_info.reg_addr[2] = 0xA0; |
| nand_info->slc_program_info.reg_addr[3] = 0xA1; |
| |
| nand_info->slc_program_info.reg_offset_value[0] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[1] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[2] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[3] = 0x0A; |
| |
| |
| nand_info->read_rety_info.get_default_value = |
| aml_nand_get_read_default_value_hynix; |
| nand_info->read_rety_info.save_default_value = |
| aml_nand_save_read_default_value_hynix; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_hynix; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_hynix; |
| |
| nand_info->slc_program_info.enter_enslc_mode = |
| aml_nand_enter_enslc_mode_hynix; |
| nand_info->slc_program_info.exit_enslc_mode = |
| aml_nand_exit_enslc_mode_hynix; |
| nand_info->slc_program_info.get_default_value = |
| aml_nand_get_slc_default_value_hynix; |
| |
| } else if(!strncmp((char*)type->id, (char*)dev_id_hynix_20nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id)) |
| ||(!strncmp((char*)type->id, (char*)dev_id_hynix_20nm_lga_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id)))) { |
| |
| nand_info->type = HYNIX_20NM_4GB; |
| aml_chip->ran_mode = 1; |
| printk("aml_chip->hynix_new_nand_type =: %d \n", |
| nand_info->type); |
| |
| //read retry |
| nand_info->read_rety_info.reg_cnt = 8; |
| nand_info->read_rety_info.retry_cnt = 7; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0xB0; |
| nand_info->read_rety_info.reg_addr[1] = 0xB1; |
| nand_info->read_rety_info.reg_addr[2] = 0xB2; |
| nand_info->read_rety_info.reg_addr[3] = 0xB3; |
| nand_info->read_rety_info.reg_addr[4] = 0xB4; |
| nand_info->read_rety_info.reg_addr[5] = 0xB5; |
| nand_info->read_rety_info.reg_addr[6] = 0xB6; |
| nand_info->read_rety_info.reg_addr[7] = 0xB7; |
| |
| nand_info->slc_program_info.reg_cnt = 4; |
| |
| nand_info->slc_program_info.reg_addr[0] = 0xA0; |
| nand_info->slc_program_info.reg_addr[1] = 0xA1; |
| nand_info->slc_program_info.reg_addr[2] = 0xA7; |
| nand_info->slc_program_info.reg_addr[3] = 0xA8; |
| |
| nand_info->slc_program_info.reg_offset_value[0] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[1] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[2] = 0x0A; |
| nand_info->slc_program_info.reg_offset_value[3] = 0x0A; |
| |
| |
| nand_info->read_rety_info.get_default_value = |
| aml_nand_get_read_default_value_hynix; |
| nand_info->read_rety_info.save_default_value = |
| aml_nand_save_read_default_value_hynix; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_hynix; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_hynix; |
| |
| nand_info->slc_program_info.enter_enslc_mode = |
| aml_nand_enter_enslc_mode_hynix; |
| nand_info->slc_program_info.exit_enslc_mode = |
| aml_nand_exit_enslc_mode_hynix; |
| nand_info->slc_program_info.get_default_value = |
| aml_nand_get_slc_default_value_hynix; |
| |
| } else if(!strncmp((char*)type->id, (char*)dev_id_hynix_1ynm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info->type = HYNIX_1YNM_8GB; |
| aml_chip->ran_mode = 1; |
| printk("aml_chip->hynix_new_nand_type =: %d \n", |
| nand_info->type); |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 7; |
| nand_info->read_rety_info.reg_addr[0] = 0x38; |
| nand_info->read_rety_info.reg_addr[1] = 0x39; |
| nand_info->read_rety_info.reg_addr[2] = 0x3a; |
| nand_info->read_rety_info.reg_addr[3] = 0x3b; |
| nand_info->read_rety_info.get_default_value = |
| aml_nand_get_read_default_value_hynix; |
| nand_info->read_rety_info.save_default_value = |
| aml_nand_save_read_default_value_hynix; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_hynix; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_hynix; |
| |
| } else if((!strncmp((char*)type->id, (char*)dev_id_toshiba_24nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| ||(!strncmp((char*)type->id, (char*)dev_id_toshiba_24nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| || (!strncmp((char*)type->id, (char*)dev_id_toshiba_19nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| || (!strncmp((char*)type->id,(char*)dev_id_toshiba_19nm_16g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| || (!strncmp((char*)type->id, (char*)dev_id_toshiba_19nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id)))) { |
| nand_info->type = TOSHIBA_24NM; |
| aml_chip->ran_mode = 1; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0x04; |
| nand_info->read_rety_info.reg_addr[1] = 0x05; |
| nand_info->read_rety_info.reg_addr[2] = 0x06; |
| nand_info->read_rety_info.reg_addr[3] = 0x07; |
| |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = 0x04; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = 0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = 0x08; |
| |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 6; |
| |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_toshiba; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_toshiba; |
| |
| } else if((!strncmp((char*)type->id, (char*)dev_id_toshiba_a19nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| ||(!strncmp((char*)type->id, (char*)dev_id_toshiba_a19nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id)))) { |
| nand_info->type = TOSHIBA_A19NM; |
| aml_chip->ran_mode = 1; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0x04; |
| nand_info->read_rety_info.reg_addr[1] = 0x05; |
| nand_info->read_rety_info.reg_addr[2] = 0x06; |
| nand_info->read_rety_info.reg_addr[3] = 0x07; |
| nand_info->read_rety_info.reg_addr[4] = 0x0d; |
| |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][4] = 0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][2][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][3][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][4][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][5][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][6][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][6][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][6][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][6][3] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][6][4] = 0x0; |
| |
| nand_info->read_rety_info.reg_cnt = 5; |
| nand_info->read_rety_info.retry_cnt = 7; |
| |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_toshiba; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_toshiba; |
| |
| } else if((!strncmp((char*)type->id, (char*)dev_id_samsung_2xnm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) |
| ||(!strncmp((char*)type->id, (char*)dev_id_samsung_2xnm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id)))) { |
| nand_info->type = SUMSUNG_2XNM; |
| aml_chip->ran_mode = 1; |
| |
| nand_info->read_rety_info.reg_addr[0] = 0xA7; |
| nand_info->read_rety_info.reg_addr[1] = 0xA4; |
| nand_info->read_rety_info.reg_addr[2] = 0xA5; |
| nand_info->read_rety_info.reg_addr[3] = 0xA6; |
| |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0x05; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0x28; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0xEc; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = 0xD8; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0xED; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0xF5; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0xED; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = 0xE6; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0x0F; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0x05; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0x0F; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = 0xEC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][6][0] = 0XE8; |
| nand_info->read_rety_info.reg_offset_value[0][6][1] = 0XEF; |
| nand_info->read_rety_info.reg_offset_value[0][6][2] = 0XE8; |
| nand_info->read_rety_info.reg_offset_value[0][6][3] = 0XDC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][7][0] = 0xF1; |
| nand_info->read_rety_info.reg_offset_value[0][7][1] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][7][2] = 0xFE; |
| nand_info->read_rety_info.reg_offset_value[0][7][3] = 0xF0; |
| |
| nand_info->read_rety_info.reg_offset_value[0][8][0] = 0x0A; |
| nand_info->read_rety_info.reg_offset_value[0][8][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][2] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][8][3] = 0xEC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][9][0] = 0xD0; |
| nand_info->read_rety_info.reg_offset_value[0][9][1] = 0xE2; |
| nand_info->read_rety_info.reg_offset_value[0][9][2] = 0xD0; |
| nand_info->read_rety_info.reg_offset_value[0][9][3] = 0xC2; |
| |
| nand_info->read_rety_info.reg_offset_value[0][10][0] = 0x14; |
| nand_info->read_rety_info.reg_offset_value[0][10][1] = 0x0F; |
| nand_info->read_rety_info.reg_offset_value[0][10][2] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][10][3] = 0xEC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][11][0] = 0xE8; |
| nand_info->read_rety_info.reg_offset_value[0][11][1] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][11][2] = 0xE8; |
| nand_info->read_rety_info.reg_offset_value[0][11][3] = 0xDC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][12][0] = 0X1E; |
| nand_info->read_rety_info.reg_offset_value[0][12][1] = 0X14; |
| nand_info->read_rety_info.reg_offset_value[0][12][2] = 0XFB; |
| nand_info->read_rety_info.reg_offset_value[0][12][3] = 0XEC; |
| |
| nand_info->read_rety_info.reg_offset_value[0][13][0] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][13][1] = 0xFF; |
| nand_info->read_rety_info.reg_offset_value[0][13][2] = 0xFB; |
| nand_info->read_rety_info.reg_offset_value[0][13][3] = 0xF8; |
| |
| nand_info->read_rety_info.reg_offset_value[0][14][0] = 0x07; |
| nand_info->read_rety_info.reg_offset_value[0][14][1] = 0x0C; |
| nand_info->read_rety_info.reg_offset_value[0][14][2] = 0x02; |
| nand_info->read_rety_info.reg_offset_value[0][14][3] = 0x00; |
| |
| |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 15; |
| |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_samsung; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_samsung; |
| |
| } else if(!strncmp((char*)type->id, (char*)dev_id_sandisk_24nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info->type = SANDISK_24NM; |
| aml_chip->ran_mode = 1; |
| nand_info->dynamic_read_info.dynamic_read_flag = 0; //DRF |
| nand_info->dynamic_read_info.reg_addr_init[0] = 0x04; |
| nand_info->dynamic_read_info.reg_addr_init[1] = 0x05; |
| nand_info->dynamic_read_info.reg_addr_init[2] = 0x06; |
| nand_info->dynamic_read_info.reg_addr_init[3] = 0x07; |
| nand_info->dynamic_read_info.reg_addr_init[4] = 0x08; |
| nand_info->dynamic_read_info.reg_addr_init[5] = 0x09; |
| nand_info->dynamic_read_info.reg_addr_init[6] = 0x0a; |
| nand_info->dynamic_read_info.reg_addr_init[7] = 0x0b; |
| nand_info->dynamic_read_info.reg_addr_init[8] = 0x0c; |
| nand_info->read_rety_info.reg_addr[0] = 0x04; |
| nand_info->read_rety_info.reg_addr[1] = 0x05; |
| nand_info->read_rety_info.reg_addr[2] = 0x07; |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0xf0; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0xe0; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0; |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0xff; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0xf0; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0xf0; |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0xee; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0xe0; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0xe0; |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0xde; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0xd0; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0xd0; |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0xcd; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0xc0; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0xc0; |
| nand_info->read_rety_info.reg_offset_value[0][6][0] = 0x01; |
| nand_info->read_rety_info.reg_offset_value[0][6][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][6][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][0] = 0x02; |
| nand_info->read_rety_info.reg_offset_value[0][7][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][0] = 0x03; |
| nand_info->read_rety_info.reg_offset_value[0][8][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][2] = 0x00; |
| nand_info->read_rety_info.reg_cnt = 3; |
| nand_info->read_rety_info.retry_cnt = 9; |
| nand_info->dynamic_read_info.dynamic_read_init = |
| aml_nand_dynamic_read_init; |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handle_sandisk; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_dynamic_read_exit; |
| |
| } else if(!strncmp((char*)type->id, (char*)dev_id_sandisk_a19nm_8g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| nand_info->type = SANDISK_A19NM; |
| aml_chip->ran_mode = 1; |
| nand_info->dynamic_read_info.dynamic_read_flag = 0; //DRF |
| |
| |
| nand_info->read_rety_info.reg_addr[0] = 0x11; |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 29; |
| |
| ////////////lower page read //////////////////////////////////// |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][6][0] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][6][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][6][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][6][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][7][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][7][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][8][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][8][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][9][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][9][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][9][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][9][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][10][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][10][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][10][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][10][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][11][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][11][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][11][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][11][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][12][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][12][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][12][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][12][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][13][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][13][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][13][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][13][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][14][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][14][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][14][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][14][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][15][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][15][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][15][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][15][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][16][0] = 0x10; |
| nand_info->read_rety_info.reg_offset_value[0][16][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][16][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][16][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][17][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][17][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][17][2] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][17][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][18][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][18][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][18][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][18][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][19][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][19][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][19][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][19][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][20][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][20][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][20][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][20][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][21][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][21][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][21][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][21][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][22][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][22][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][22][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][22][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][23][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][23][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][23][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][23][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][24][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][24][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][24][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][24][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][25][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][25][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][25][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][25][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][26][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][26][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][26][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][26][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][27][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][27][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][27][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][27][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][28][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][28][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][28][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][28][3] = 0x00; |
| |
| /////////////////upper page read///////////////////////////////// |
| nand_info->read_rety_info.reg_offset_value[1][0][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][1][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][3] = 0x04; |
| |
| nand_info->read_rety_info.reg_offset_value[1][2][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][3][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][3][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][3][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][3][3] = 0x08; |
| |
| nand_info->read_rety_info.reg_offset_value[1][4][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][4][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][4][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][4][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[1][5][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][5][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][5][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][5][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][6][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][6][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][6][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][6][3] = 0x04; |
| |
| nand_info->read_rety_info.reg_offset_value[1][7][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][7][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][7][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][7][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][8][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][8][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][8][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][8][3] = 0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][9][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][9][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[1][9][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][9][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[1][10][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][10][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][10][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][10][3] =0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][11][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][11][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][11][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][11][3] =0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][12][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][12][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][12][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][12][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][13][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][13][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][13][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][13][3] =0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][14][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][14][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][14][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][14][3] =0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[1][15][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][15][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][15][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][15][3] =0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][16][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][16][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][16][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][16][3] =0x04; |
| |
| nand_info->read_rety_info.reg_offset_value[1][17][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][17][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][17][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][17][3] =0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][18][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][18][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][18][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][18][3] =0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][19][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][19][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][19][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][19][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][20][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][20][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][20][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][20][3] =0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][21][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][21][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][21][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][21][3] =0x6c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][22][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][22][1] =0x70; |
| nand_info->read_rety_info.reg_offset_value[1][22][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][22][3] =0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][23][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][23][1] =0x70; |
| nand_info->read_rety_info.reg_offset_value[1][23][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][23][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][24][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][24][1] =0x70; |
| nand_info->read_rety_info.reg_offset_value[1][24][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][24][3] =0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][25][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][25][1] =0x70; |
| nand_info->read_rety_info.reg_offset_value[1][25][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][25][3] =0x6c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][26][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][26][1] =0x6c; |
| nand_info->read_rety_info.reg_offset_value[1][26][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][26][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][27][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][27][1] =0x6c; |
| nand_info->read_rety_info.reg_offset_value[1][27][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][27][3] =0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][28][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][28][1] =0x6c; |
| nand_info->read_rety_info.reg_offset_value[1][28][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][28][3] =0x6c; |
| |
| |
| nand_info->read_rety_info.read_retry_handle = |
| aml_nand_read_retry_handleA19_sandisk; |
| nand_info->read_rety_info.read_retry_exit = |
| aml_nand_read_retry_exit_A19_sandisk; |
| |
| } else if(!strncmp((char*)type->id, (char*)dev_id_sandisk_a19nm_4g, |
| strlen((const char*)aml_nand_flash_ids[i].id))) { |
| |
| nand_info->type = SANDISK_A19NM_4G; |
| aml_chip->ran_mode = 1; |
| nand_info->dynamic_read_info.dynamic_read_flag = 0; //DRF |
| |
| |
| nand_info->read_rety_info.reg_addr[0] = 0x11; |
| nand_info->read_rety_info.reg_cnt = 4; |
| nand_info->read_rety_info.retry_cnt = 30; |
| |
| ////////////lower page read //////////////////////////////////// |
| nand_info->read_rety_info.reg_offset_value[0][0][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][0][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][0][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][0][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][1][0] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][1][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][1][2] = 0x7C; |
| nand_info->read_rety_info.reg_offset_value[0][1][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][2][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][2][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][2][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][2][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][3][0] = 0x08; |
| nand_info->read_rety_info.reg_offset_value[0][3][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][3][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][3][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][4][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][4][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][4][2] = 0x7C; |
| nand_info->read_rety_info.reg_offset_value[0][4][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][5][0] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[0][5][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][5][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][5][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][6][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][6][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][6][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][6][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][7][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][7][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][8][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][8][2] = 0x7C; |
| nand_info->read_rety_info.reg_offset_value[0][8][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][9][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][9][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][9][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][9][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][10][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][10][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][10][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][10][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][11][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][11][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][11][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][11][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][12][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][12][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][12][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][12][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][13][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][13][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][13][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][13][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][14][0] = 0x0C; |
| nand_info->read_rety_info.reg_offset_value[0][14][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][14][2] = 0x7C; |
| nand_info->read_rety_info.reg_offset_value[0][14][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][15][0] = 0x0C; |
| nand_info->read_rety_info.reg_offset_value[0][15][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][15][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][15][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][16][0] = 0x10; |
| nand_info->read_rety_info.reg_offset_value[0][16][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][16][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][16][3] = 0x00; |
| |
| |
| nand_info->read_rety_info.reg_offset_value[0][17][0] = 0x10; |
| nand_info->read_rety_info.reg_offset_value[0][17][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][17][2] = 0x04; |
| nand_info->read_rety_info.reg_offset_value[0][17][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][18][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][18][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][18][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][18][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][19][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][19][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][19][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][19][3] = 0x00; |
| |
| |
| nand_info->read_rety_info.reg_offset_value[0][20][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][20][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][20][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][20][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][21][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][21][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][21][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][21][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][22][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][22][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][22][2] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][22][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][23][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][23][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][23][2] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][23][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][24][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][24][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][24][2] = 0x6C; |
| nand_info->read_rety_info.reg_offset_value[0][24][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][25][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][25][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][25][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][25][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][26][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][26][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][26][2] = 0x70; |
| nand_info->read_rety_info.reg_offset_value[0][26][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][27][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][27][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][27][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][27][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][28][0] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[0][28][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][28][2] = 0x68; |
| nand_info->read_rety_info.reg_offset_value[0][28][3] = 0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[0][29][0] = 0x74; |
| nand_info->read_rety_info.reg_offset_value[0][29][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[0][29][2] = 0x6c; |
| nand_info->read_rety_info.reg_offset_value[0][29][3] = 0x00; |
| |
| /////////////////upper page read/////////////////////////////// |
| nand_info->read_rety_info.reg_offset_value[1][0][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][0][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][1][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][1][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][2][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][1] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][3] = 0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][3][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][3][1] = 0x7C; |
| nand_info->read_rety_info.reg_offset_value[1][3][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][3][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][4][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][4][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][4][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][4][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][5][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][5][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][5][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][5][3] = 0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][6][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][6][1] = 0x7c; |
| nand_info->read_rety_info.reg_offset_value[1][6][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][6][3] = 0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][7][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][7][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[1][7][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][7][3] = 0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][8][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][8][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[1][8][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][8][3] = 0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][9][0] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][9][1] = 0x78; |
| nand_info->read_rety_info.reg_offset_value[1][2][2] = 0x00; |
| nand_info->read_rety_info.reg_offset_value[1][2][3] = 0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][10][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][10][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][10][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][10][3] =0x70; |
| |
| nand_info->read_rety_info.reg_offset_value[1][11][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][11][1] =0x78; |
| nand_info->read_rety_info.reg_offset_value[1][11][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][11][3] =0x6c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][12][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][12][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][12][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][12][3] =0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[1][13][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][13][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][13][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][13][3] =0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][14][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][14][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][14][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][14][3] =0x78; |
| |
| nand_info->read_rety_info.reg_offset_value[1][15][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][15][1] =0x04; |
| nand_info->read_rety_info.reg_offset_value[1][15][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][15][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][16][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][16][1] =0x08; |
| nand_info->read_rety_info.reg_offset_value[1][16][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][16][3] =0x7c; |
| |
| nand_info->read_rety_info.reg_offset_value[1][17][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][17][1] =0x08; |
| nand_info->read_rety_info.reg_offset_value[1][17][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][17][3] =0x00; |
| |
| nand_info->read_rety_info.reg_offset_value[1][18][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][18][1] =0x74; |
| nand_info->read_rety_info.reg_offset_value[1][18][2] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][18][3] =0x74; |
| |
| nand_info->read_rety_info.reg_offset_value[1][19][0] =0x00; |
| nand_info->read_rety_info.reg_offset_value[1][19][1] =0x74; |
| nand_info->read_rety_info
|