dts: rt685: enabled flexcomm15

the RT685 contains an additional flexcomm peripheral, that supports
only I2C. This commit adds this peripheral to the device tree,
and enables pins and clocks for flexcomm15.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2021-09-21 14:12:23 -05:00 committed by Christopher Friedt
commit b18aefdfd3
5 changed files with 61 additions and 0 deletions

View file

@ -961,6 +961,50 @@ static int mimxrt685_evk_pinmux_init(const struct device *dev)
IOPCTL_PinMuxSet(IOPCTL, 2U, 9U, port2_pin9_config);
#endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(pmic_i2c), nxp_lpc_i2c, okay) && CONFIG_I2C
const uint32_t fc15_i2c_scl_config = (/* Pin is configured as I2C_SCL */
IOPCTL_PIO_FUNC0 |
/* Enable pull-up / pull-down function */
IOPCTL_PIO_PUPD_EN |
/* Enable pull-up function */
IOPCTL_PIO_PULLUP_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_EN |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Normal drive */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is enabled */
IOPCTL_PIO_PSEDRAIN_EN |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);
/* FC15_SCL PIN (coords: E16) is configured as I2C SCL */
IOPCTL->FC15_I2C_SCL = fc15_i2c_scl_config;
const uint32_t fc15_i2c_sda_config = (/* Pin is configured as I2C_SDA */
IOPCTL_PIO_FUNC0 |
/* Enable pull-up / pull-down function */
IOPCTL_PIO_PUPD_EN |
/* Enable pull-up function */
IOPCTL_PIO_PULLUP_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_EN |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Normal drive */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is enabled */
IOPCTL_PIO_PSEDRAIN_EN |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);
/* FC15_SDA PIN (coords: F16) is configured as I2C SDA */
IOPCTL->FC15_I2C_SDA = fc15_i2c_sda_config;
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpadc0), okay) && CONFIG_ADC
/*
* The current test and sample applications uses a single channel for

View file

@ -64,6 +64,9 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(
case MCUX_FLEXCOMM7_CLK:
*rate = CLOCK_GetFlexCommClkFreq(7);
break;
case MCUX_PMIC_I2C_CLK:
*rate = CLOCK_GetFlexCommClkFreq(15);
break;
case MCUX_HS_SPI_CLK:
#if defined(FSL_FEATURE_FLEXCOMM8_SPI_INDEX)
*rate = CLOCK_GetHsLspiClkFreq();

View file

@ -189,6 +189,15 @@
status = "disabled";
};
pmic_i2c: i2c@127000 {
compatible = "nxp,lpc-i2c";
reg = <0x127000 0x1000>;
interrupts = <21 0>;
label = "PMIC_I2C";
clocks = <&clkctl1 MCUX_PMIC_I2C_CLK>;
status = "disabled";
};
usbhs: usbhs@144000 {
compatible = "nxp,mcux-usbd";
reg = <0x144000 0x1000>;

View file

@ -15,6 +15,7 @@
#define MCUX_FLEXCOMM5_CLK 5
#define MCUX_FLEXCOMM6_CLK 6
#define MCUX_FLEXCOMM7_CLK 7
#define MCUX_PMIC_I2C_CLK 16
#define MCUX_HS_SPI_CLK 8
#define MCUX_USDHC1_CLK 9
#define MCUX_USDHC2_CLK 10

View file

@ -235,6 +235,10 @@ static ALWAYS_INLINE void clock_init(void)
CLOCK_AttachClk(kSFRO_to_FLEXCOMM2);
#endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(pmic_i2c), nxp_lpc_i2c, okay)
CLOCK_AttachClk(kFFRO_to_FLEXCOMM15);
#endif
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexcomm4), nxp_lpc_usart, okay)
CLOCK_AttachClk(kSFRO_to_FLEXCOMM4);
#endif