From ae8d4edede352db6dbabb01763db040c98d02fc6 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Fri, 14 Sep 2018 16:18:41 -0500 Subject: [PATCH] soc: arm: Enable the lpspi driver and clock for the imxrt soc Enables the mcux lpspi shim driver and subsystem clock for the imxrt soc. Signed-off-by: Maureen Helm --- soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 | 7 +++++++ soc/arm/nxp_imx/rt/Kconfig.soc | 2 ++ soc/arm/nxp_imx/rt/soc.c | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 index 35c1a53f584..ecf65aa186c 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 +++ b/soc/arm/nxp_imx/rt/Kconfig.defconfig.mimxrt1052 @@ -44,4 +44,11 @@ config UART_MCUX_LPUART endif # SERIAL +if SPI + +config SPI_MCUX_LPSPI + def_bool y + +endif # SPI + endif # SOC_MIMXRT1052 diff --git a/soc/arm/nxp_imx/rt/Kconfig.soc b/soc/arm/nxp_imx/rt/Kconfig.soc index 70af4009e74..c5eb92ccfe5 100644 --- a/soc/arm/nxp_imx/rt/Kconfig.soc +++ b/soc/arm/nxp_imx/rt/Kconfig.soc @@ -14,6 +14,7 @@ config SOC_MIMXRT1051 select HAS_MCUX select HAS_MCUX_CCM select HAS_MCUX_IGPIO + select HAS_MCUX_LPSPI select HAS_MCUX_LPUART select CPU_HAS_FPU select CPU_HAS_MPU @@ -26,6 +27,7 @@ config SOC_MIMXRT1052 select HAS_MCUX select HAS_MCUX_CCM select HAS_MCUX_IGPIO + select HAS_MCUX_LPSPI select HAS_MCUX_LPUART select CPU_HAS_FPU select CPU_HAS_MPU diff --git a/soc/arm/nxp_imx/rt/soc.c b/soc/arm/nxp_imx/rt/soc.c index dee613f8bc2..eb02eb552d9 100644 --- a/soc/arm/nxp_imx/rt/soc.c +++ b/soc/arm/nxp_imx/rt/soc.c @@ -90,6 +90,11 @@ static ALWAYS_INLINE void clkInit(void) CLOCK_SetDiv(kCLOCK_UartDiv, 0); /* Set UART divider to 1 */ #endif +#ifdef CONFIG_SPI_MCUX_LPSPI + CLOCK_SetMux(kCLOCK_LpspiMux, 1); /* Set SPI source to USB1 PFD0 720M */ + CLOCK_SetDiv(kCLOCK_LpspiDiv, 7); /* Set SPI divider to 8 */ +#endif + /* Keep the system clock running so SYSTICK can wake up the system from * wfi. */