We configure UART1 to DTE mode, then we define pinmux in board-mx6q-sabresd.h
MX6Q_PAD_CSI0_DAT10__UART1_TXD
MX6Q_PAD_CSI0_DAT11__UART1_RXD
and there are defined in iomux-mx6q.h
#define _MX6Q_PAD_CSI0_DAT10__UART1_TXD \
IOMUX_PAD(0x0650, 0x0280, 3, 0x0000, 0, 0)
#define _MX6Q_PAD_CSI0_DAT11__UART1_RXD \
IOMUX_PAD(0x0654, 0x0284, 3, 0x0920,1, 0)
I can see description with
MX6Q_PAD_CSI0_DAT10__UART1_TXD \
IOMUX_PAD(0x0650, 0x0280, 3, 0x0000, 0, 0)
it describe pad-CSI0_DATA10 is routed to UART1_TX_DATA in DTE mode, so we can see IOMUX_PAD has argument with 0, it is make sense. but what is the other one ?
there is no explanation about
MX6Q_PAD_CSI0_DAT11__UART1_RXD \
IOMUX_PAD(0x0654, 0x0284, 3, 0x0920,1, 0)
I have not seeing any definition with DTE mode of UAR1_RXD
Thank you.
Hi Bernie
there is no definitions of DTE/DCE in "IOMUX_PAD" macros.
In DTE mode UARTx_TX_DATA is input, so it is necessary to choose
definition where MX6Q_PAD_CSI0_DAT10 is input:
#define MX6Q_PAD_CSI0_DAT10__UART1_RXD IOMUX_PAD(0x0650, 0x0280, 3, 0x0920, 0, 0)
0x920 is address IOMUXC_UART1_UART_RX_DATA_SELECT_INPUT
0 - CSI0_DATA10_ALT3 — Selecting ALT3 mode of pad CSI0_DAT10 for UART1_TX_DATA.
"SELECT_INPUT" is used only for input signals, UARTx_TX_DATA is this case.
UARTx_RX_DATA is output, "SELECT_INPUT" is not used for it, used only "mux_mode"
(=3 in this case).
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov
Thanks your sharing, now I know select input only for input signal via your explanation. I have attach our code and I want to know what happen to below case?
step 1: I configure UART1 to DTE mode, so I add some code in borad-imx6q-sabresd.c:
static const struct imxuart_platform_data mx6q_sabresd_uart1_data __initconst = {
.flags = IMXUART_HAVE_RTSCTS | IMXUART_USE_DCEDTE,
.dma_req_rx = MX6Q_DMA_REQ_UART1_RX,
.dma_req_tx = MX6Q_DMA_REQ_UART1_TX,
};
static inline void mx6q_sabresd_init_uart(void) {
imx6q_add_imx_uart(0, &mx6q_sabresd_uart1_data);
}
step 2: define pin mux in borad-imx6q-sabresd.h
MX6Q_PAD_CSI0_DAT10__UART1_TXD
MX6Q_PAD_CSI0_DAT11__UART1_RXD
step 3: define iomux in iomux-mx6q.h
#define _MX6Q_PAD_CSI0_DAT10__UART1_TXD \
IOMUX_PAD(0x0650, 0x0280, 3, 0x0000, 0, 0)
#define _MX6Q_PAD_CSI0_DAT11__UART1_RXD \
IOMUX_PAD(0x0654, 0x0284, 3, 0x0920,1, 0)
We find we only can send message from board to computer, but message which is can be send from computer to board via UART1. If I revise the definition of
#define _MX6Q_PAD_CSI0_DAT11__UART1_RXD \
IOMUX_PAD(0x0654, 0x0284, 3, 0x0920,1, 0)
to
#define _MX6Q_PAD_CSI0_DAT11__UART1_RXD \
IOMUX_PAD(0x0654, 0x0284, 3, 0x0920,0, 0)
then it can be resolved with each direction. Because we use DTE mode, so RX_DATA can't be routed to CSI0_DATA11 of DCE mode? Am I correct?
Thank you