|
|
@@ -815,7 +815,15 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
read_reg_dma(nandc, NAND_FLASH_STATUS, 1, NAND_BAM_NEXT_SGL);
|
|
|
|
|
|
ret = submit_descs(nandc);
|
|
|
-@@ -2864,7 +2815,7 @@ static int qcom_param_page_type_exec(str
|
|
|
+@@ -2862,14 +2813,14 @@ static int qcom_param_page_type_exec(str
|
|
|
+
|
|
|
+ reg_base = NAND_READ_LOCATION_0;
|
|
|
+
|
|
|
+- if (nandc->props->qpic_v2)
|
|
|
++ if (nandc->props->qpic_version2)
|
|
|
+ reg_base = NAND_READ_LOCATION_LAST_CW_0;
|
|
|
+
|
|
|
+ ret = qcom_parse_instructions(chip, subop, &q_op);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
|
|
|
@@ -824,7 +832,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
|
|
|
nandc->buf_count = 0;
|
|
|
nandc->buf_start = 0;
|
|
|
-@@ -2872,38 +2823,38 @@ static int qcom_param_page_type_exec(str
|
|
|
+@@ -2877,52 +2828,52 @@ static int qcom_param_page_type_exec(str
|
|
|
clear_read_regs(nandc);
|
|
|
clear_bam_transaction(nandc);
|
|
|
|
|
|
@@ -890,9 +898,14 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
}
|
|
|
|
|
|
instr = q_op.data_instr;
|
|
|
-@@ -2912,9 +2863,9 @@ static int qcom_param_page_type_exec(str
|
|
|
+ op_id = q_op.data_instr_idx;
|
|
|
+ len = nand_subop_get_data_len(subop, op_id);
|
|
|
|
|
|
- nandc_set_read_loc(chip, 0, 0, 0, len, 1);
|
|
|
+- if (nandc->props->qpic_v2)
|
|
|
++ if (nandc->props->qpic_version2)
|
|
|
+ nandc_set_read_loc_last(chip, reg_base, 0, len, 1);
|
|
|
+ else
|
|
|
+ nandc_set_read_loc_first(chip, reg_base, 0, len, 1);
|
|
|
|
|
|
- if (!nandc->props->qpic_v2) {
|
|
|
- write_reg_dma(nandc, NAND_DEV_CMD_VLD, 1, 0);
|
|
|
@@ -903,7 +916,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
}
|
|
|
|
|
|
nandc->buf_count = 512;
|
|
|
-@@ -2926,9 +2877,10 @@ static int qcom_param_page_type_exec(str
|
|
|
+@@ -2934,9 +2885,10 @@ static int qcom_param_page_type_exec(str
|
|
|
nandc->buf_count, 0);
|
|
|
|
|
|
/* restore CMD1 and VLD regs */
|
|
|
@@ -917,7 +930,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
}
|
|
|
|
|
|
ret = submit_descs(nandc);
|
|
|
-@@ -3017,7 +2969,7 @@ static const struct nand_controller_ops
|
|
|
+@@ -3025,7 +2977,7 @@ static const struct nand_controller_ops
|
|
|
|
|
|
static void qcom_nandc_unalloc(struct qcom_nand_controller *nandc)
|
|
|
{
|
|
|
@@ -926,7 +939,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
if (!dma_mapping_error(nandc->dev, nandc->reg_read_dma))
|
|
|
dma_unmap_single(nandc->dev, nandc->reg_read_dma,
|
|
|
MAX_REG_RD *
|
|
|
-@@ -3070,7 +3022,7 @@ static int qcom_nandc_alloc(struct qcom_
|
|
|
+@@ -3078,7 +3030,7 @@ static int qcom_nandc_alloc(struct qcom_
|
|
|
if (!nandc->reg_read_buf)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
@@ -935,7 +948,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
nandc->reg_read_dma =
|
|
|
dma_map_single(nandc->dev, nandc->reg_read_buf,
|
|
|
MAX_REG_RD *
|
|
|
-@@ -3151,15 +3103,15 @@ static int qcom_nandc_setup(struct qcom_
|
|
|
+@@ -3159,15 +3111,15 @@ static int qcom_nandc_setup(struct qcom_
|
|
|
u32 nand_ctrl;
|
|
|
|
|
|
/* kill onenand */
|
|
|
@@ -954,7 +967,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
nand_ctrl = nandc_read(nandc, NAND_CTRL);
|
|
|
|
|
|
/*
|
|
|
-@@ -3176,7 +3128,7 @@ static int qcom_nandc_setup(struct qcom_
|
|
|
+@@ -3184,7 +3136,7 @@ static int qcom_nandc_setup(struct qcom_
|
|
|
}
|
|
|
|
|
|
/* save the original values of these registers */
|
|
|
@@ -963,7 +976,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
nandc->cmd1 = nandc_read(nandc, dev_cmd_reg_addr(nandc, NAND_DEV_CMD1));
|
|
|
nandc->vld = NAND_DEV_CMD_VLD_VAL;
|
|
|
}
|
|
|
-@@ -3349,7 +3301,7 @@ static int qcom_nandc_parse_dt(struct pl
|
|
|
+@@ -3357,7 +3309,7 @@ static int qcom_nandc_parse_dt(struct pl
|
|
|
struct device_node *np = nandc->dev->of_node;
|
|
|
int ret;
|
|
|
|
|
|
@@ -972,7 +985,7 @@ Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
ret = of_property_read_u32(np, "qcom,cmd-crci",
|
|
|
&nandc->cmd_crci);
|
|
|
if (ret) {
|
|
|
-@@ -3474,30 +3426,30 @@ static void qcom_nandc_remove(struct pla
|
|
|
+@@ -3482,30 +3434,30 @@ static void qcom_nandc_remove(struct pla
|
|
|
|
|
|
static const struct qcom_nandc_props ipq806x_nandc_props = {
|
|
|
.ecc_modes = (ECC_RS_4BIT | ECC_BCH_8BIT),
|