Commit 671cb652 authored by Diego Sueiro's avatar Diego Sueiro Committed by Maureen Helm
Browse files

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: default avatarDiego Sueiro <diego.sueiro@gmail.com>
parent 4eee8a67
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -69,6 +69,13 @@ static void nxp_mcimx7_gpio_config(void)
	CCM_ControlGate(CCM, ccmCcgrGateGpio2, ccmClockNeededRunWait);
#endif /* CONFIG_GPIO_IMX_PORT_2 */


#ifdef CONFIG_GPIO_IMX_PORT_7
	RDC_SetPdapAccess(RDC, rdcPdapGpio7, GPIO_7_RDC, false, false);
	/* Enable gpio clock gate */
	CCM_ControlGate(CCM, ccmCcgrGateGpio7, ccmClockNeededRunWait);
#endif /* CONFIG_GPIO_IMX_PORT_2 */

}
#endif /* CONFIG_GPIO_IMX */

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

#ifdef CONFIG_UART_IMX_UART_6
	/* We need to grasp board uart exclusively */
	RDC_SetPdapAccess(RDC, rdcPdapUart6, UART_6_RDC, false, false);
	/* Select clock derived from OSC clock(24M) */
	CCM_UpdateRoot(CCM, ccmRootUart6, ccmRootmuxUartOsc24m, 0, 0);
	/* Enable uart clock */
	CCM_EnableRoot(CCM, ccmRootUart6);
	/*
	 * IC Limitation
	 * M4 stop will cause A7 UART lose functionality
	 * So we need UART clock all the time
	 */
	CCM_ControlGate(CCM, ccmCcgrGateUart6, ccmClockNeededAll);
#endif /* #ifdef CONFIG_UART_IMX_UART_6 */
}
#endif /* CONFIG_UART_IMX */