From 28ee0683b50b83faa72c5c888e7f271b13454369 Mon Sep 17 00:00:00 2001 From: Xabier Marquiegui Date: Thu, 27 Jan 2022 16:34:18 +0100 Subject: [PATCH] boards: mimxrt: enable pps output Enable pps output for mimxrt1050 and mimxrt1060 based boards for gptp sample application validation. Signed-off-by: Hake Huang Co-authored-by: Seb Laveze Signed-off-by: Xabier Marquiegui --- boards/arm/mimxrt1050_evk/doc/index.rst | 4 ++++ boards/arm/mimxrt1050_evk/pinmux.c | 11 +++++++++++ boards/arm/mimxrt1060_evk/doc/index.rst | 4 ++++ boards/arm/mimxrt1060_evk/pinmux.c | 12 ++++++++++++ 4 files changed, 31 insertions(+) diff --git a/boards/arm/mimxrt1050_evk/doc/index.rst b/boards/arm/mimxrt1050_evk/doc/index.rst index cb6df2413a1acc..a34e65b0033091 100644 --- a/boards/arm/mimxrt1050_evk/doc/index.rst +++ b/boards/arm/mimxrt1050_evk/doc/index.rst @@ -249,6 +249,10 @@ The MIMXRT1050 SoC has five pairs of pinmux/gpio controllers. +---------------+-----------------+---------------------------+ | GPIO_SD_B0_05 | USDHC1_DATA3 | SD Card | +---------------+-----------------+---------------------------+ +| GPIO_AD_B1_02 | 1588_EVENT2_OUT | 1588 | ++---------------+-----------------+---------------------------+ +| GPIO_AD_B1_03 | 1588_EVENT2_IN | 1588 | ++---------------+-----------------+---------------------------+ .. note:: In order to use the SPI peripheral on this board, resistors R278, diff --git a/boards/arm/mimxrt1050_evk/pinmux.c b/boards/arm/mimxrt1050_evk/pinmux.c index ce40626e908937..f652fc3df92b1b 100644 --- a/boards/arm/mimxrt1050_evk/pinmux.c +++ b/boards/arm/mimxrt1050_evk/pinmux.c @@ -283,6 +283,17 @@ static int mimxrt1050_evk_init(const struct device *dev) /* pull up the ENET_INT before RESET. */ GPIO_WritePinOutput(GPIO1, 10, 1); GPIO_WritePinOutput(GPIO1, 9, 0); + +#if defined(CONFIG_PTP_CLOCK_MCUX) + /* GPIO_AD_B1_02 is configured as 1588_EVENT2_OUT */ + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_02_ENET_1588_EVENT2_OUT, 0U); + /* GPIO_AD_B1_02 PAD functional properties */ + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_02_ENET_1588_EVENT2_OUT, 0x10B0u); + /* GPIO_AD_B1_03 is configured as 1588_EVENT2_IN */ + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_03_ENET_1588_EVENT2_IN, 0U); + /* GPIO_AD_B1_03 PAD functional properties */ + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_03_ENET_1588_EVENT2_IN, 0xB0E9); +#endif #endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(lcdif), okay) && CONFIG_DISPLAY diff --git a/boards/arm/mimxrt1060_evk/doc/index.rst b/boards/arm/mimxrt1060_evk/doc/index.rst index a31fa40e740073..068e977dbe8416 100644 --- a/boards/arm/mimxrt1060_evk/doc/index.rst +++ b/boards/arm/mimxrt1060_evk/doc/index.rst @@ -265,6 +265,10 @@ The MIMXRT1060 SoC has five pairs of pinmux/gpio controllers. +---------------+-----------------+---------------------------+ | GPIO_AD_B1_15 | SAI1_TX_SYNC | I2S | +---------------+-----------------+---------------------------+ +| GPIO_AD_B1_02 | 1588_EVENT2_OUT | 1588 | ++---------------+-----------------+---------------------------+ +| GPIO_AD_B1_03 | 1588_EVENT2_IN | 1588 | ++---------------+-----------------+---------------------------+ .. note:: In order to use the SPI peripheral on this board, resistors R278, R279, diff --git a/boards/arm/mimxrt1060_evk/pinmux.c b/boards/arm/mimxrt1060_evk/pinmux.c index f10da0714cf46d..3a597c22b2b7b3 100644 --- a/boards/arm/mimxrt1060_evk/pinmux.c +++ b/boards/arm/mimxrt1060_evk/pinmux.c @@ -219,6 +219,18 @@ static int mimxrt1060_evk_init(const struct device *dev) /* pull up the ENET_INT before RESET. */ GPIO_WritePinOutput(GPIO1, 10, 1); GPIO_WritePinOutput(GPIO1, 9, 0); + +#if defined(CONFIG_PTP_CLOCK_MCUX) + /* GPIO_AD_B1_02 is configured as 1588_EVENT2_OUT */ + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_02_ENET_1588_EVENT2_OUT, 0U); + /* GPIO_AD_B1_02 PAD functional properties */ + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_02_ENET_1588_EVENT2_OUT, 0x10B0u); + /* GPIO_AD_B1_03 is configured as 1588_EVENT2_IN */ + IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_03_ENET_1588_EVENT2_IN, 0U); + /* GPIO_AD_B1_03 PAD functional properties */ + IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_03_ENET_1588_EVENT2_IN, 0xB0E9); +#endif + #endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(lcdif), okay) && CONFIG_DISPLAY