From 3e67ed8179b411249625baf7aa88fc0295fb0190 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 3 Apr 2017 00:06:24 +0200 Subject: apalis/colibri imx6: disable ri and dcd irq in uarts If the UART is used in DTE mode the RI and DCD bits in UCR3 become irq enable bits. Both are set to enabled after reset and both likely are pending. Disable the bits also on UARTs not used in the boot loader to prevent an interrupt storm when Linux enables the UART interrupts. Signed-off-by: Max Krummenacher Acked-by: Marcel Ziswiler --- board/toradex/apalis_imx6/apalis_imx6.c | 8 ++++++++ board/toradex/colibri_imx6/colibri_imx6.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index bb5f2bcb18..8b14f5fa08 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -300,6 +300,9 @@ iomux_v3_cfg_t const usb_pads[] = { * UARTs are used in DTE mode, switch the mode on all UARTs before * any pinmuxing connects a (DCE) output to a transceiver output. */ +#define UCR3 0x88 /* FIFO Control Register */ +#define UCR3_RI (1<<8) /* RIDELT DTE mode */ +#define UCR3_DCD (1<<9) /* DCDDELT DTE mode */ #define UFCR 0x90 /* FIFO Control Register */ #define UFCR_DCEDTE (1<<6) /* DCE=0 */ @@ -309,6 +312,11 @@ static void setup_dtemode_uart(void) setbits_le32((u32 *)(UART2_BASE + UFCR), UFCR_DCEDTE); setbits_le32((u32 *)(UART4_BASE + UFCR), UFCR_DCEDTE); setbits_le32((u32 *)(UART5_BASE + UFCR), UFCR_DCEDTE); + + clrbits_le32((u32 *)(UART1_BASE + UCR3), UCR3_DCD | UCR3_RI); + clrbits_le32((u32 *)(UART2_BASE + UCR3), UCR3_DCD | UCR3_RI); + clrbits_le32((u32 *)(UART4_BASE + UCR3), UCR3_DCD | UCR3_RI); + clrbits_le32((u32 *)(UART5_BASE + UCR3), UCR3_DCD | UCR3_RI); } static void setup_dcemode_uart(void) { diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 8bf4046e7d..20daa5c447 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -261,6 +261,9 @@ iomux_v3_cfg_t const usb_pads[] = { * UARTs are used in DTE mode, switch the mode on all UARTs before * any pinmuxing connects a (DCE) output to a transceiver output. */ +#define UCR3 0x88 /* FIFO Control Register */ +#define UCR3_RI (1<<8) /* RIDELT DTE mode */ +#define UCR3_DCD (1<<9) /* DCDDELT DTE mode */ #define UFCR 0x90 /* FIFO Control Register */ #define UFCR_DCEDTE (1<<6) /* DCE=0 */ @@ -269,6 +272,10 @@ static void setup_dtemode_uart(void) setbits_le32((u32 *)(UART1_BASE + UFCR), UFCR_DCEDTE); setbits_le32((u32 *)(UART2_BASE + UFCR), UFCR_DCEDTE); setbits_le32((u32 *)(UART3_BASE + UFCR), UFCR_DCEDTE); + + clrbits_le32((u32 *)(UART1_BASE + UCR3), UCR3_DCD | UCR3_RI); + clrbits_le32((u32 *)(UART2_BASE + UCR3), UCR3_DCD | UCR3_RI); + clrbits_le32((u32 *)(UART3_BASE + UCR3), UCR3_DCD | UCR3_RI); } static void setup_iomux_uart(void) -- cgit v1.2.3