From 979904b6af1132fa5f96f28a6c29035341f2f96e Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 5 May 2020 06:42:12 -0500 Subject: [PATCH] soc: arm: nxp_lpc: Convert from Kconfig to DT_NODELABEL As we phase out per instance Kconfig symbols convert to utilize DT_NODELABEL for SPI and I2C instances instead. Also updated comments to change from FLEXCOMM8 to HSLSPI. Signed-off-by: Kumar Gala --- soc/arm/nxp_lpc/lpc54xxx/soc.c | 10 ++++++---- soc/arm/nxp_lpc/lpc55xxx/soc.c | 13 +++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/soc/arm/nxp_lpc/lpc54xxx/soc.c b/soc/arm/nxp_lpc/lpc54xxx/soc.c index cbf0f884ce..819c06052a 100644 --- a/soc/arm/nxp_lpc/lpc54xxx/soc.c +++ b/soc/arm/nxp_lpc/lpc54xxx/soc.c @@ -67,21 +67,23 @@ static ALWAYS_INLINE void clock_init(void) /* Attach 12 MHz clock to FLEXCOMM0 */ CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0); -#ifdef CONFIG_I2C_4 +#if DT_HAS_NODE(DT_NODELABEL(flexcomm4)) && \ + DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm4), nxp_lpc_i2c) /* attach 12 MHz clock to FLEXCOMM4 */ CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4); /* reset FLEXCOMM for I2C */ RESET_PeripheralReset(kFC4_RST_SHIFT_RSTn); -#endif /* CONFIG_I2C_4 */ +#endif -#ifdef CONFIG_SPI_5 +#if DT_HAS_NODE(DT_NODELABEL(flexcomm5)) && \ + DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm5), nxp_lpc_spi) /* Attach 12 MHz clock to FLEXCOMM5 */ CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5); /* reset FLEXCOMM for SPI */ RESET_PeripheralReset(kFC5_RST_SHIFT_RSTn); -#endif /* CONFIG_SPI_5 */ +#endif #endif /* CONFIG_SOC_LPC54114_M4 */ } diff --git a/soc/arm/nxp_lpc/lpc55xxx/soc.c b/soc/arm/nxp_lpc/lpc55xxx/soc.c index 0ede9672bf..b04ed766e8 100644 --- a/soc/arm/nxp_lpc/lpc55xxx/soc.c +++ b/soc/arm/nxp_lpc/lpc55xxx/soc.c @@ -61,21 +61,22 @@ static ALWAYS_INLINE void clock_init(void) /* Enables the clock for the I/O controller.: Enable Clock. */ CLOCK_EnableClock(kCLOCK_Iocon); -#ifdef CONFIG_I2C_4 +#if DT_HAS_NODE(DT_NODELABEL(flexcomm4)) && \ + DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm4), nxp_lpc_i2c) /* attach 12 MHz clock to FLEXCOMM4 */ CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4); /* reset FLEXCOMM for I2C */ RESET_PeripheralReset(kFC4_RST_SHIFT_RSTn); -#endif /* CONFIG_I2C_4 */ +#endif -#ifdef CONFIG_SPI_8 - /* Attach 12 MHz clock to FLEXCOMM8 */ +#if DT_HAS_NODE(DT_NODELABEL(hs_lspi)) + /* Attach 12 MHz clock to HSLSPI */ CLOCK_AttachClk(kFRO12M_to_HSLSPI); - /* reset FLEXCOMM for SPI */ + /* reset HSLSPI for SPI */ RESET_PeripheralReset(kHSLSPI_RST_SHIFT_RSTn); -#endif /* CONFIG_SPI_8 */ +#endif #endif /* CONFIG_SOC_LPC55S69_CPU0 */ }