Skip to content

Commit 443440c

Browse files
Sivaprakash Murugesanmiquelraynal
authored andcommitted
mtd: rawnand: qcom: avoid write to unavailable register
SFLASHC_BURST_CFG is only available on older ipq NAND platforms, this register has been removed when the NAND controller got implemented in the qpic controller. Avoid writing this register on devices which are based on qpic NAND controller. Fixes: dce8476 ("mtd: nand: qcom: Support for IPQ8074 QPIC NAND controller") Cc: [email protected] Signed-off-by: Sivaprakash Murugesan <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 735bf22 commit 443440c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/mtd/nand/raw/qcom_nandc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,13 @@ struct qcom_nand_host {
459459
* among different NAND controllers.
460460
* @ecc_modes - ecc mode for NAND
461461
* @is_bam - whether NAND controller is using BAM
462+
* @is_qpic - whether NAND CTRL is part of qpic IP
462463
* @dev_cmd_reg_start - NAND_DEV_CMD_* registers starting offset
463464
*/
464465
struct qcom_nandc_props {
465466
u32 ecc_modes;
466467
bool is_bam;
468+
bool is_qpic;
467469
u32 dev_cmd_reg_start;
468470
};
469471

@@ -2774,7 +2776,8 @@ static int qcom_nandc_setup(struct qcom_nand_controller *nandc)
27742776
u32 nand_ctrl;
27752777

27762778
/* kill onenand */
2777-
nandc_write(nandc, SFLASHC_BURST_CFG, 0);
2779+
if (!nandc->props->is_qpic)
2780+
nandc_write(nandc, SFLASHC_BURST_CFG, 0);
27782781
nandc_write(nandc, dev_cmd_reg_addr(nandc, NAND_DEV_CMD_VLD),
27792782
NAND_DEV_CMD_VLD_VAL);
27802783

@@ -3035,12 +3038,14 @@ static const struct qcom_nandc_props ipq806x_nandc_props = {
30353038
static const struct qcom_nandc_props ipq4019_nandc_props = {
30363039
.ecc_modes = (ECC_BCH_4BIT | ECC_BCH_8BIT),
30373040
.is_bam = true,
3041+
.is_qpic = true,
30383042
.dev_cmd_reg_start = 0x0,
30393043
};
30403044

30413045
static const struct qcom_nandc_props ipq8074_nandc_props = {
30423046
.ecc_modes = (ECC_BCH_4BIT | ECC_BCH_8BIT),
30433047
.is_bam = true,
3048+
.is_qpic = true,
30443049
.dev_cmd_reg_start = 0x7000,
30453050
};
30463051

0 commit comments

Comments
 (0)