/* Check Status */
ret = toshiba_nand_benand_read_eccstatus_op(chip, ecc_status); if (!ret) { unsignedint i, bitflips = 0;
for (i = 0; i < chip->ecc.steps; i++) {
bitflips = ecc_status[i] & TOSHIBA_NAND_ECC_STATUS_MASK; if (bitflips == TOSHIBA_NAND_ECC_STATUS_UNCORR) {
mtd->ecc_stats.failed++;
} else {
mtd->ecc_stats.corrected += bitflips;
max_bitflips = max(max_bitflips, bitflips);
}
}
return max_bitflips;
}
/* * Fallback to regular status check if * toshiba_nand_benand_read_eccstatus_op() failed.
*/
ret = nand_status_op(chip, &status); if (ret) return ret;
/* * On BENAND, the entire OOB region can be used by the MTD user. * The calculated ECC bytes are stored into other isolated * area which is not accessible to users. * This is why chip->ecc.bytes = 0.
*/
chip->ecc.bytes = 0;
chip->ecc.size = 512;
chip->ecc.strength = 8;
chip->ecc.read_page = toshiba_nand_read_page_benand;
chip->ecc.read_subpage = toshiba_nand_read_subpage_benand;
chip->ecc.write_page = nand_write_page_raw;
chip->ecc.read_page_raw = nand_read_page_raw_notsupp;
chip->ecc.write_page_raw = nand_write_page_raw_notsupp;
/* * Toshiba 24nm raw SLC (i.e., not BENAND) have 32B OOB per * 512B page. For Toshiba SLC, we decode the 5th/6th byte as * follows: * - ID byte 6, bits[2:0]: 100b -> 43nm, 101b -> 32nm, * 110b -> 24nm * - ID byte 5, bit[7]: 1 -> BENAND, 0 -> raw SLC
*/ if (chip->id.len >= 6 && nand_is_slc(chip) &&
(chip->id.data[5] & 0x7) == 0x6 /* 24nm */ &&
!(chip->id.data[4] & TOSHIBA_NAND_ID4_IS_BENAND) /* !BENAND */) {
memorg->oobsize = 32 * memorg->pagesize >> 9;
mtd->oobsize = memorg->oobsize;
}
/* * Extract ECC requirements from 6th id byte. * For Toshiba SLC, ecc requrements are as follows: * - 43nm: 1 bit ECC for each 512Byte is required. * - 32nm: 4 bit ECC for each 512Byte is required. * - 24nm: 8 bit ECC for each 512Byte is required.
*/ if (chip->id.len >= 6 && nand_is_slc(chip)) {
requirements.step_size = 512; switch (chip->id.data[5] & 0x7) { case 0x4:
requirements.strength = 1; break; case 0x5:
requirements.strength = 4; break; case 0x6:
requirements.strength = 8; break; default:
WARN(1, "Could not get ECC info");
requirements.step_size = 0; break;
}
}
/* Check that chip is BENAND and ECC mode is on-die */ if (nand_is_slc(chip) &&
chip->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE &&
chip->id.data[4] & TOSHIBA_NAND_ID4_IS_BENAND)
toshiba_nand_benand_init(chip);
if (!strcmp("TC58TEG5DCLTA00", chip->parameters.model))
tc58teg5dclta00_init(chip); if (!strncmp("TC58NVG0S3E", chip->parameters.model, sizeof("TC58NVG0S3E") - 1))
tc58nvg0s3e_init(chip); if ((!strncmp("TH58NVG2S3HBAI4", chip->parameters.model, sizeof("TH58NVG2S3HBAI4") - 1)) ||
(!strncmp("TH58NVG3S0HBAI4", chip->parameters.model, sizeof("TH58NVG3S0HBAI4") - 1)))
th58nvg2s3hbai4_init(chip);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.