diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2016-11-09 08:13:51 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-11-11 08:57:25 +0100 |
commit | 3dc136ef875f7a875c58b2b4684d2404a062326d (patch) | |
tree | 44b6db17edf8f18be92d6d202b3ea7c3592c9f55 /arch/arm/mach-imx | |
parent | a5ef52e50291541eb6e7d1b1e5c7f25940177527 (diff) | |
download | barebox-3dc136ef875f7a875c58b2b4684d2404a062326d.tar.gz barebox-3dc136ef875f7a875c58b2b4684d2404a062326d.tar.xz |
i.MX: Add DEBUG_LL hooks for VF610
Add code to support DEBUG_LL functionality on VF610/Vybrid platform.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/include/mach/debug_ll.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h index 5c2db6cd51..a132f3c163 100644 --- a/arch/arm/mach-imx/include/mach/debug_ll.h +++ b/arch/arm/mach-imx/include/mach/debug_ll.h @@ -14,8 +14,10 @@ #include <mach/imx51-regs.h> #include <mach/imx53-regs.h> #include <mach/imx6-regs.h> +#include <mach/vf610-regs.h> #include <serial/imx-uart.h> +#include <serial/lpuart.h> #ifdef CONFIG_DEBUG_LL @@ -42,6 +44,8 @@ #define IMX_DEBUG_SOC MX53 #elif defined CONFIG_DEBUG_IMX6Q_UART #define IMX_DEBUG_SOC MX6 +#elif defined CONFIG_DEBUG_VF610_UART +#define IMX_DEBUG_SOC VF610 #else #error "unknown i.MX debug uart soc type" #endif @@ -74,6 +78,13 @@ static inline void imx6_uart_setup_ll(void) imx6_uart_setup(base); } +static inline void vf610_uart_setup_ll(void) +{ + void *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC, CONFIG_DEBUG_IMX_UART_PORT)); + + lpuart_setup(base, 66000000); +} + static inline void PUTC_LL(int c) { void __iomem *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC, @@ -82,14 +93,19 @@ static inline void PUTC_LL(int c) if (!base) return; - imx_uart_putc(base, c); + if (IS_ENABLED(CONFIG_DEBUG_VF610_UART)) + lpuart_putc(base, c); + else + imx_uart_putc(base, c); } + #else static inline void imx50_uart_setup_ll(void) {} static inline void imx51_uart_setup_ll(void) {} static inline void imx53_uart_setup_ll(void) {} static inline void imx6_uart_setup_ll(void) {} +static inline void vf610_uart_setup_ll(void) {} #endif /* CONFIG_DEBUG_LL */ @@ -115,4 +131,13 @@ static inline void imx53_ungate_all_peripherals(void) imx_ungate_all_peripherals(IOMEM(MX53_CCM_BASE_ADDR)); } +static inline void vf610_ungate_all_peripherals(void) +{ + void __iomem *ccmbase = IOMEM(VF610_CCM_BASE_ADDR); + int i; + + for (i = 0x40; i <= 0x6c; i += 4) + writel(0xffffffff, ccmbase + i); +} + #endif /* __MACH_DEBUG_LL_H__ */ |