From 059098fe07e06d5ebec484a5b4747197955b53ce Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 6 May 2015 12:32:03 -0700 Subject: i.MX: serial: Distil common clock ungating code Move all of the common clock ungating code in early UART initialization into a dedicated subroutine that can be shared by all of the users. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/include/mach/debug_ll.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch/arm/mach-imx/include/mach/debug_ll.h') diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h index 1f35e81532..ab939b3a88 100644 --- a/arch/arm/mach-imx/include/mach/debug_ll.h +++ b/arch/arm/mach-imx/include/mach/debug_ll.h @@ -101,8 +101,22 @@ static inline void imx_uart_setup_ll(void __iomem *uartbase, unsigned int refclock) { } + static inline void imx51_uart_setup_ll(void) {} static inline void imx6_uart_setup_ll(void) {} #endif /* CONFIG_DEBUG_LL */ + +static inline void imx_ungate_all_peripherals(void __iomem *ccmbase) +{ + int i; + for (i = 0x68; i <= 0x80; i += 4) + writel(0xffffffff, ccmbase + i); +} + +static inline void imx6_ungate_all_peripherals(void) +{ + imx_ungate_all_peripherals(IOMEM(MX6_CCM_BASE_ADDR)); +} + #endif /* __MACH_DEBUG_LL_H__ */ -- cgit v1.2.3