};
/*
-@@ -460,12 +475,14 @@ struct qcom_nand_host {
- * @ecc_modes - ecc mode for NAND
+@@ -475,13 +490,15 @@ struct qcom_nand_host {
* @is_bam - whether NAND controller is using BAM
* @is_qpic - whether NAND CTRL is part of qpic IP
+ * @qpic_v2 - flag to indicate QPIC IP version 2
+ * @has_boot_pages - whether NAND has different ecc settings for boot pages
* @dev_cmd_reg_start - NAND_DEV_CMD_* registers starting offset
*/
u32 ecc_modes;
bool is_bam;
bool is_qpic;
+ bool qpic_v2;
+ bool has_boot_pages;
u32 dev_cmd_reg_start;
};
data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
oob_size1 = host->bbm_size;
-- if (cw == (ecc->steps - 1)) {
-+ if (cw == (ecc->steps - 1) && !host->boot_pages_conf) {
+- if (qcom_nandc_is_last_cw(ecc, cw)) {
++ if (qcom_nandc_is_last_cw(ecc, cw) && !host->boot_pages_conf) {
data_size2 = ecc->size - data_size1 -
((ecc->steps - 1) * 4);
oob_size2 = (ecc->steps * 4) + host->ecc_bytes_hw +
}
for_each_set_bit(cw, &uncorrectable_cws, ecc->steps) {
-- if (cw == (ecc->steps - 1)) {
-+ if (cw == (ecc->steps - 1) && !host->boot_pages_conf) {
+- if (qcom_nandc_is_last_cw(ecc, cw)) {
++ if (qcom_nandc_is_last_cw(ecc, cw) && !host->boot_pages_conf) {
data_size = ecc->size - ((ecc->steps - 1) * 4);
oob_size = (ecc->steps * 4) + host->ecc_bytes_hw;
} else {
for (i = 0; i < ecc->steps; i++) {
int data_size, oob_size;
-- if (i == (ecc->steps - 1)) {
-+ if (i == (ecc->steps - 1) && !host->boot_pages_conf) {
+- if (qcom_nandc_is_last_cw(ecc, i)) {
++ if (qcom_nandc_is_last_cw(ecc, i) && !host->boot_pages_conf) {
data_size = ecc->size - ((ecc->steps - 1) << 2);
oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
host->spare_bytes;
for (i = 0; i < ecc->steps; i++) {
int data_size, oob_size;
-- if (i == (ecc->steps - 1)) {
-+ if (i == (ecc->steps - 1) && !host->boot_pages_conf) {
+- if (qcom_nandc_is_last_cw(ecc, i)) {
++ if (qcom_nandc_is_last_cw(ecc, i) && !host->boot_pages_conf) {
data_size = ecc->size - ((ecc->steps - 1) << 2);
oob_size = (ecc->steps << 2) + host->ecc_bytes_hw +
host->spare_bytes;
data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
oob_size1 = host->bbm_size;
-- if (i == (ecc->steps - 1)) {
-+ if (i == (ecc->steps - 1) && !host->boot_pages_conf) {
+- if (qcom_nandc_is_last_cw(ecc, i)) {
++ if (qcom_nandc_is_last_cw(ecc, i) && !host->boot_pages_conf) {
data_size2 = ecc->size - data_size1 -
((ecc->steps - 1) << 2);
oob_size2 = (ecc->steps << 2) + host->ecc_bytes_hw +