Skip to content

Commit 671cb65

Browse files
diegosueiroMaureenHelm
authored andcommitted
arch/mcimx7_m4: Add pad, clock and gate config for GPIO7 and UART6
Adds the necessery configuration for using the GPIO7 and UART6 on i.MX7 platforms. Signed-off-by: Diego Sueiro <[email protected]>
1 parent 4eee8a6 commit 671cb65

File tree

1 file changed

+21
-0
lines changed
  • arch/arm/soc/nxp_imx/mcimx7_m4

1 file changed

+21
-0
lines changed

arch/arm/soc/nxp_imx/mcimx7_m4/soc.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ static void nxp_mcimx7_gpio_config(void)
6969
CCM_ControlGate(CCM, ccmCcgrGateGpio2, ccmClockNeededRunWait);
7070
#endif /* CONFIG_GPIO_IMX_PORT_2 */
7171

72+
73+
#ifdef CONFIG_GPIO_IMX_PORT_7
74+
RDC_SetPdapAccess(RDC, rdcPdapGpio7, GPIO_7_RDC, false, false);
75+
/* Enable gpio clock gate */
76+
CCM_ControlGate(CCM, ccmCcgrGateGpio7, ccmClockNeededRunWait);
77+
#endif /* CONFIG_GPIO_IMX_PORT_2 */
78+
7279
}
7380
#endif /* CONFIG_GPIO_IMX */
7481

@@ -91,6 +98,20 @@ static void nxp_mcimx7_uart_config(void)
9198
CCM_ControlGate(CCM, ccmCcgrGateUart2, ccmClockNeededAll);
9299
#endif /* #ifdef CONFIG_UART_IMX_UART_2 */
93100

101+
#ifdef CONFIG_UART_IMX_UART_6
102+
/* We need to grasp board uart exclusively */
103+
RDC_SetPdapAccess(RDC, rdcPdapUart6, UART_6_RDC, false, false);
104+
/* Select clock derived from OSC clock(24M) */
105+
CCM_UpdateRoot(CCM, ccmRootUart6, ccmRootmuxUartOsc24m, 0, 0);
106+
/* Enable uart clock */
107+
CCM_EnableRoot(CCM, ccmRootUart6);
108+
/*
109+
* IC Limitation
110+
* M4 stop will cause A7 UART lose functionality
111+
* So we need UART clock all the time
112+
*/
113+
CCM_ControlGate(CCM, ccmCcgrGateUart6, ccmClockNeededAll);
114+
#endif /* #ifdef CONFIG_UART_IMX_UART_6 */
94115
}
95116
#endif /* CONFIG_UART_IMX */
96117

0 commit comments

Comments
 (0)