I am working on i.MX8QM BSP 5.4.70.
The default BSP uses lpuart0 as u-boot and kernel debug port. In our custom board, we would like to change it to lpuart3 or lpuart4 as the u-boot and kernel debug port. We can't make it work. It outputs nothing. The ways we did are as follows.
At u-boot dts file,
-----
chosen {
bootargs = "console=ttyLP4,115200 earlycon";
stdout-path = &lpuart4;
};
pinctrl_lpuart4: lpuart4grp {
fsl,pins = <
SC_P_M40_GPIO0_00_DMA_UART4_RX 0x06000020
SC_P_M40_GPIO0_01_DMA_UART4_TX 0x06000020
>;
};
&lpuart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpuart4>;
status = "okay";
};
----
At u-boot board file,
----
static iomux_cfg_t uart4_pads[] = {
SC_P_M40_GPIO0_00 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M40.GPIO0.IO00, M40.TPM0.CH0, DMA.UART4.RX, LSIO.GPIO0.IO08 */
SC_P_M40_GPIO0_01 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M40.GPIO0.IO01, M40.TPM0.CH1, DMA.UART4.TX, LSIO.GPIO0.IO09 */
};
static void setup_iomux_uart4(void)
{
imx8_iomux_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
}
/* Set UART4 clock root to 80 MHz */
ret = sc_pm_setup_uart(SC_R_UART_4, rate);
if (ret)
return ret;
setup_iomux_uart4();
----
If I switch back to lpuart0, it can boot into Yocto OS and the lpuart4 works well. The hardware is fine.
Is there anything that I should do in scfw? How?
-Eric
已解决! 转到解答。
serial clock is obtained using get_lpuart_clk function which is defined for
i.MX8 platforms in uboot../imx8/clock.c and it seems that returns the clock for UART0:
err = sc_pm_get_clock_rate((..,SC_R_UART_0, 2, &clkrate);
So, one can try to change clock to SC_R_UART_N
Best regards
igor
Hi Eric
one can change lpuart0 to lpuart4 in board_quiesce_devices()
remove lpuart4 "dma" in dtsi file
also some patches were sent via mail
Best regards
igor
Igor,
Your suggestion does not work at all. I still got nothing outputs from lpuart3 or lpuart4.
These two ports are pinmuxed from M40 and M41.
static iomux_cfg_t uart3_pads[] = {
SC_P_M41_GPIO0_00 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M41.GPIO0.IO00, M41.TPM0.CH0, DMA.UART3.RX, LSIO.GPIO0.IO12 */
SC_P_M41_GPIO0_01 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M41.GPIO0.IO01, M41.TPM0.CH1, DMA.UART3.TX, LSIO.GPIO0.IO13 */
};
and
static iomux_cfg_t uart4_pads[] = {
SC_P_M40_GPIO0_00 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M40.GPIO0.IO00, M40.TPM0.CH0, DMA.UART4.RX, LSIO.GPIO0.IO08 */
SC_P_M40_GPIO0_01 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(UART_PAD_CTRL), /* M40.GPIO0.IO01, M40.TPM0.CH1, DMA.UART4.TX, LSIO.GPIO0.IO09 */
};
Should I do anything in scfw?
-Eric
serial clock is obtained using get_lpuart_clk function which is defined for
i.MX8 platforms in uboot../imx8/clock.c and it seems that returns the clock for UART0:
err = sc_pm_get_clock_rate((..,SC_R_UART_0, 2, &clkrate);
So, one can try to change clock to SC_R_UART_N
Best regards
igor