Skip to content

Commit 1849567

Browse files
hanxu-nxpbroonie
authored andcommitted
spi: nxp-fspi: reset the FLSHxCR1 registers
Reset the FLSHxCR1 registers to default value. ROM may set the register value and it affects the SPI NAND normal functions. Signed-off-by: Han Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0bb80ec commit 1849567

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/spi/spi-nxp-fspi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,13 @@ static int nxp_fspi_default_setup(struct nxp_fspi *f)
10841084
fspi_writel(f, FSPI_AHBCR_PREF_EN | FSPI_AHBCR_RDADDROPT,
10851085
base + FSPI_AHBCR);
10861086

1087+
/* Reset the FLSHxCR1 registers. */
1088+
reg = FSPI_FLSHXCR1_TCSH(0x3) | FSPI_FLSHXCR1_TCSS(0x3);
1089+
fspi_writel(f, reg, base + FSPI_FLSHA1CR1);
1090+
fspi_writel(f, reg, base + FSPI_FLSHA2CR1);
1091+
fspi_writel(f, reg, base + FSPI_FLSHB1CR1);
1092+
fspi_writel(f, reg, base + FSPI_FLSHB2CR1);
1093+
10871094
/* AHB Read - Set lut sequence ID for all CS. */
10881095
fspi_writel(f, SEQID_LUT, base + FSPI_FLSHA1CR2);
10891096
fspi_writel(f, SEQID_LUT, base + FSPI_FLSHA2CR2);

0 commit comments

Comments
 (0)