summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/include')
-rw-r--r--arch/arm/mach-imx/include/mach/bbu.h9
-rw-r--r--arch/arm/mach-imx/include/mach/clock-imx51_53.h5
-rw-r--r--arch/arm/mach-imx/include/mach/debug_ll.h77
3 files changed, 69 insertions, 22 deletions
diff --git a/arch/arm/mach-imx/include/mach/bbu.h b/arch/arm/mach-imx/include/mach/bbu.h
index 5eb9a47363..8039091395 100644
--- a/arch/arm/mach-imx/include/mach/bbu.h
+++ b/arch/arm/mach-imx/include/mach/bbu.h
@@ -75,15 +75,6 @@ static inline int imx_bbu_external_nor_register_handler(const char *name, char *
}
#endif
-#if defined(CONFIG_BAREBOX_UPDATE_IMX6_NAND)
-int imx6_bbu_nand_register_handler(const char *name, unsigned long flags);
-#else
-static inline int imx6_bbu_nand_register_handler(const char *name, unsigned long flags)
-{
- return -ENOSYS;
-}
-#endif
-
#if defined(CONFIG_BAREBOX_UPDATE_IMX_EXTERNAL_NAND)
int imx_bbu_external_nand_register_handler(const char *name, char *devicefile,
unsigned long flags);
diff --git a/arch/arm/mach-imx/include/mach/clock-imx51_53.h b/arch/arm/mach-imx/include/mach/clock-imx51_53.h
index 6004a6d36c..0f25dfbf2f 100644
--- a/arch/arm/mach-imx/include/mach/clock-imx51_53.h
+++ b/arch/arm/mach-imx/include/mach/clock-imx51_53.h
@@ -149,6 +149,7 @@
#define MX5_CCM_CACRR_ARM_PODF_MASK (0x7)
/* Define the bits in register CBCDR */
+#define MX5_CCM_CBCDR_RESET_VALUE (0x19239145)
#define MX5_CCM_CBCDR_EMI_CLK_SEL (0x1 << 26)
#define MX5_CCM_CBCDR_PERIPH_CLK_SEL (0x1 << 25)
#define MX5_CCM_CBCDR_DDR_HF_SEL_OFFSET (30)
@@ -193,6 +194,7 @@
#define MX5_CCM_CBCMR_PERCLK_IPG_CLK_SEL (0x1 << 0)
/* Define the bits in register CSCMR1 */
+#define MX5_CCM_CSCMR1_RESET_VALUE (0xa6a2a020)
#define MX5_CCM_CSCMR1_SSI_EXT2_CLK_SEL_OFFSET (30)
#define MX5_CCM_CSCMR1_SSI_EXT2_CLK_SEL_MASK (0x3 << 30)
#define MX5_CCM_CSCMR1_SSI_EXT1_CLK_SEL_OFFSET (28)
@@ -259,6 +261,7 @@
#define MX5_CCM_CSCMR2_SPDIF0_CLK_SEL_MASK (0x3)
/* Define the bits in register CSCDR1 */
+#define MX5_CCM_CSCDR1_RESET_VALUE (0x00c30318)
#define MX5_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_OFFSET (22)
#define MX5_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_MASK (0x7 << 22)
#define MX5_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_OFFSET (19)
@@ -585,5 +588,3 @@
#define MX5_SRPGC_EMI_PDNSCR (MX5_SRPGC_EMI_BASE + 0x8)
#endif /* __ARCH_ARM_MACH_MX51_CRM_REGS_H__ */
-
-
diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h
index f34eaa139f..ab939b3a88 100644
--- a/arch/arm/mach-imx/include/mach/debug_ll.h
+++ b/arch/arm/mach-imx/include/mach/debug_ll.h
@@ -3,6 +3,7 @@
#include <io.h>
#include <config.h>
+#include <common.h>
#include <mach/imx1-regs.h>
#include <mach/imx21-regs.h>
#include <mach/imx25-regs.h>
@@ -13,8 +14,40 @@
#include <mach/imx53-regs.h>
#include <mach/imx6-regs.h>
+#include <serial/imx-uart.h>
+
#ifdef CONFIG_DEBUG_LL
+#define __IMX_UART_BASE(soc, num) soc##_UART##num##_BASE_ADDR
+#define IMX_UART_BASE(soc, num) __IMX_UART_BASE(soc, num)
+
+static inline void imx_uart_setup_ll(void __iomem *uartbase,
+ unsigned int refclock)
+{
+ writel(0x00000000, uartbase + UCR1);
+
+ writel(UCR2_IRTS | UCR2_WS | UCR2_TXEN | UCR2_RXEN | UCR2_SRST,
+ uartbase + UCR2);
+ writel(UCR3_DSR | UCR3_DCD | UCR3_RI | UCR3_ADNIMP | UCR3_RXDMUXSEL,
+ uartbase + UCR3);
+ writel((0b10 << UFCR_TXTL_SHF) | UFCR_RFDIV1 | (1 << UFCR_RXTL_SHF),
+ uartbase + UFCR);
+
+ writel(baudrate_to_ubir(CONFIG_BAUDRATE),
+ uartbase + UBIR);
+ writel(refclock_to_ubmr(refclock),
+ uartbase + UBMR);
+
+ writel(UCR1_UARTEN, uartbase + UCR1);
+}
+
+#define __imx_uart_setup_ll(refclock) \
+ do { \
+ imx_uart_setup_ll(IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC, \
+ CONFIG_DEBUG_IMX_UART_PORT)), \
+ refclock); \
+ } while(0)
+
#ifdef CONFIG_DEBUG_IMX1_UART
#define IMX_DEBUG_SOC MX1
#elif defined CONFIG_DEBUG_IMX21_UART
@@ -37,21 +70,20 @@
#error "unknown i.MX debug uart soc type"
#endif
-#define __IMX_UART_BASE(soc, num) soc##_UART##num##_BASE_ADDR
-#define IMX_UART_BASE(soc, num) __IMX_UART_BASE(soc, num)
-
-#define URTX0 0x40 /* Transmitter Register */
-
-#define UCR1 0x80 /* Control Register 1 */
-#define UCR1_UARTEN (1 << 0) /* UART enabled */
+static inline void imx51_uart_setup_ll(void)
+{
+ __imx_uart_setup_ll(54000000);
+}
-#define USR2 0x98 /* Status Register 2 */
-#define USR2_TXDC (1 << 3) /* Transmitter complete */
+static inline void imx6_uart_setup_ll(void)
+{
+ __imx_uart_setup_ll(80000000);
+}
static inline void PUTC_LL(int c)
{
- void __iomem *base = (void *)IMX_UART_BASE(IMX_DEBUG_SOC,
- CONFIG_DEBUG_IMX_UART_PORT);
+ void __iomem *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC,
+ CONFIG_DEBUG_IMX_UART_PORT));
if (!base)
return;
@@ -63,5 +95,28 @@ static inline void PUTC_LL(int c)
writel(c, base + URTX0);
}
+#else
+
+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__ */