Skip to content

Commit 614180a

Browse files
BoughChenbroonie
authored andcommitted
spi: spi-nxp-fspi: extract function nxp_fspi_dll_override()
Extract function nxp_fspi_dll_override(), this is the suggested setting when clock rate < 100MHz. Just the preparation of supportting DTR mode. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20250917-flexspi-ddr-v2-1-bb9fe2a01889@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ab63e99 commit 614180a

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

drivers/spi/spi-nxp-fspi.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,17 @@ static void nxp_fspi_dll_calibration(struct nxp_fspi *f)
674674
dev_warn(f->dev, "DLL lock failed, please fix it!\n");
675675
}
676676

677+
/*
678+
* Config the DLL register to default value, enable the target clock delay
679+
* line delay cell override mode, and use 1 fixed delay cell in DLL delay
680+
* chain, this is the suggested setting when clock rate < 100MHz.
681+
*/
682+
static void nxp_fspi_dll_override(struct nxp_fspi *f)
683+
{
684+
fspi_writel(f, FSPI_DLLACR_OVRDEN, f->iobase + FSPI_DLLACR);
685+
fspi_writel(f, FSPI_DLLBCR_OVRDEN, f->iobase + FSPI_DLLBCR);
686+
}
687+
677688
/*
678689
* In FlexSPI controller, flash access is based on value of FSPI_FLSHXXCR0
679690
* register and start base address of the target device.
@@ -1071,13 +1082,7 @@ static int nxp_fspi_default_setup(struct nxp_fspi *f)
10711082
/* Disable the module */
10721083
fspi_writel(f, FSPI_MCR0_MDIS, base + FSPI_MCR0);
10731084

1074-
/*
1075-
* Config the DLL register to default value, enable the target clock delay
1076-
* line delay cell override mode, and use 1 fixed delay cell in DLL delay
1077-
* chain, this is the suggested setting when clock rate < 100MHz.
1078-
*/
1079-
fspi_writel(f, FSPI_DLLACR_OVRDEN, base + FSPI_DLLACR);
1080-
fspi_writel(f, FSPI_DLLBCR_OVRDEN, base + FSPI_DLLBCR);
1085+
nxp_fspi_dll_override(f);
10811086

10821087
/* enable module */
10831088
fspi_writel(f, FSPI_MCR0_AHB_TIMEOUT(0xFF) |

0 commit comments

Comments
 (0)