HI,
I have a custom board based on AM625 and needed to get console output in UART2. I tried this following patch specified in below thread. Basically I get few lines output. After that it stops. Please let me know what would be the probable issue?
output from UART-2:
U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:36:12 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Ca2c)
k3_ddrss memorycontroller@f300000: clk get failed-2
the following patch has been applied.
diff --git a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi index b4a5e3cfa1..d5976095e9 100644 --- a/arch/arm/dts/k3-am62x-r5-sk-common.dtsi +++ b/arch/arm/dts/k3-am62x-r5-sk-common.dtsi @@ -13,7 +13,7 @@ }; chosen { - stdout-path = "serial2:115200n8"; + stdout-path = "serial4:115200n8"; tick-timer = &timer1; }; diff --git a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi index b57d9563d8..acc064337a 100644 --- a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi +++ b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi @@ -6,7 +6,7 @@ / { chosen { - stdout-path = "serial2:115200n8"; + stdout-path = "serial4:115200n8"; tick-timer = &timer1; }; diff --git a/arch/arm/dts/k3-am62x-sk-common.dtsi b/arch/arm/dts/k3-am62x-sk-common.dtsi index 72ebb1400f..58a3bc713e 100644 --- a/arch/arm/dts/k3-am62x-sk-common.dtsi +++ b/arch/arm/dts/k3-am62x-sk-common.dtsi @@ -14,7 +14,7 @@ / { aliases { - serial2 = &main_uart0; + serial4 = &main_uart2; mmc0 = &sdhci0; mmc1 = &sdhci1; mmc2 = &sdhci2; @@ -25,8 +25,8 @@ }; chosen { - stdout-path = "serial2:115200n8"; - bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000"; + stdout-path = "serial4:115200n8"; + bootargs = "console=ttyS4,115200n8 earlycon=ns16550a,mmio32,0x02820000"; }; memory@80000000 { @@ -154,10 +154,17 @@ }; &main_pmx0 { - main_uart0_pins_default: main-uart0-pins-default { + // main_uart0_pins_default: main-uart0-pins-default { + // pinctrl-single,pins = < + // AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */ + // AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */ + // >; + // }; + + main_uart2_pins_default: main-uart2-pins-default { pinctrl-single,pins = < - AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */ - AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */ + AM62X_IOPAD(0x01d0, PIN_INPUT, 3) /* (B14) UART0_CTSn.UART2_RXD */ + AM62X_IOPAD(0x01d4, PIN_OUTPUT, 3) /* (C13) UART0_RTSn.UART2_TXD */ >; }; @@ -301,8 +308,7 @@ }; &main_uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&main_uart0_pins_default>; + status = "disabled"; }; &main_uart1 { @@ -311,7 +317,9 @@ }; &main_uart2 { - status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <&main_uart2_pins_default>; + status = "okay"; }; &main_uart3 { diff --git a/arch/arm/mach-k3/am62x/clk-data.c b/arch/arm/mach-k3/am62x/clk-data.c index 47ea973197..9f8d7d7e6f 100644 --- a/arch/arm/mach-k3/am62x/clk-data.c +++ b/arch/arm/mach-k3/am62x/clk-data.c @@ -115,11 +115,16 @@ static const char * const wkup_clksel_out0_parents[] = { "hsdiv4_16fft_mcu_0_hsdivout0_clk", }; -static const char * const main_usart0_fclk_sel_out0_parents[] = { - "usart_programmable_clock_divider_out0", +static const char * const main_usart2_fclk_sel_out0_parents[] = { + "usart_programmable_clock_divider_out2", "hsdiv4_16fft_main_1_hsdivout1_clk", }; +// static const char * const main_usart0_fclk_sel_out0_parents[] = { +// "usart_programmable_clock_divider_out0", +// "hsdiv4_16fft_main_1_hsdivout1_clk", +// }; + static const struct clk_data clk_list[] = { CLK_FIXED_RATE("osc_26_mhz", 26000000, 0), CLK_FIXED_RATE("osc_25_mhz", 25000000, 0), @@ -199,10 +204,12 @@ static const struct clk_data clk_list[] = { CLK_MUX("main_gpmc_fclk_sel_out0", main_gpmc_fclk_sel_out0_parents, 2, 0x108180, 0, 1, 0), CLK_MUX("main_gtcclk_sel_out0", main_gtcclk_sel_out0_parents, 8, 0x43008030, 0, 3, 0), CLK_MUX("main_ospi_ref_clk_sel_out0", main_ospi_ref_clk_sel_out0_parents, 2, 0x108500, 0, 1, 0), - CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out0", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x108240, 0, 2, 0, 0, 48000000), + CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out2", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x108248, 0, 2, 0, 0, 48000000), + //CLK_DIV_DEFFREQ("usart_programmable_clock_divider_out0", "hsdiv4_16fft_main_1_hsdivout0_clk", 0x108240, 0, 2, 0, 0, 48000000), CLK_MUX("wkup_clkout_sel_out0", wkup_clkout_sel_out0_parents, 8, 0x43008020, 0, 3, 0), CLK_MUX("wkup_clksel_out0", wkup_clksel_out0_parents, 2, 0x43008010, 0, 1, 0), - CLK_MUX("main_usart0_fclk_sel_out0", main_usart0_fclk_sel_out0_parents, 2, 0x108280, 0, 1, 0), + CLK_MUX("main_usart2_fclk_sel_out0", main_usart2_fclk_sel_out0_parents, 2, 0x108288, 0, 1, 0), + //CLK_MUX("main_usart0_fclk_sel_out0", main_usart0_fclk_sel_out0_parents, 2, 0x108280, 0, 1, 0), CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout1_clk", "pllfracf2_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040084, 0, 7, 0, 0), CLK_FIXED_RATE("mshsi2c_wkup_0_porscl", 0, 0), CLK_DIV("sam62_pll_ctrl_wrap_main_0_chip_div24_clk_clk", "sam62_pll_ctrl_wrap_main_0_sysclkout_clk", 0x41011c, 0, 5, 0, 0), @@ -297,10 +304,14 @@ static const struct dev_clk soc_dev_clk_data[] = { DEV_CLK(136, 0, "hsdiv0_16fft_main_8_hsdivout0_clk"), DEV_CLK(140, 0, "sam62_pll_ctrl_wrap_mcu_0_chip_div1_clk_clk"), DEV_CLK(140, 1, "sam62_pll_ctrl_wrap_mcu_0_chip_div1_clk_clk"), - DEV_CLK(146, 0, "main_usart0_fclk_sel_out0"), - DEV_CLK(146, 1, "usart_programmable_clock_divider_out0"), - DEV_CLK(146, 2, "hsdiv4_16fft_main_1_hsdivout1_clk"), - DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"), + // DEV_CLK(146, 0, "main_usart0_fclk_sel_out0"), + // DEV_CLK(146, 1, "usart_programmable_clock_divider_out0"), + // DEV_CLK(146, 2, "hsdiv4_16fft_main_1_hsdivout1_clk"), + // DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"), + DEV_CLK(153, 0, "main_usart2_fclk_sel_out0"), + DEV_CLK(153, 1, "usart_programmable_clock_divider_out2"), + DEV_CLK(153, 2, "hsdiv4_16fft_main_1_hsdivout1_clk"), + DEV_CLK(153, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"), DEV_CLK(157, 20, "clkout0_ctrl_out0"), DEV_CLK(157, 21, "hsdiv4_16fft_main_2_hsdivout1_clk"), DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk"), diff --git a/arch/arm/mach-k3/am62x/dev-data.c b/arch/arm/mach-k3/am62x/dev-data.c index f413313533..a1954d5ca2 100644 --- a/arch/arm/mach-k3/am62x/dev-data.c +++ b/arch/arm/mach-k3/am62x/dev-data.c @@ -62,7 +62,8 @@ static struct ti_dev soc_dev_list[] = { PSC_DEV(162, &soc_lpsc_list[10]), PSC_DEV(75, &soc_lpsc_list[11]), PSC_DEV(102, &soc_lpsc_list[12]), - PSC_DEV(146, &soc_lpsc_list[12]), + PSC_DEV(153, &soc_lpsc_list[12]), + // PSC_DEV(146, &soc_lpsc_list[12]), PSC_DEV(13, &soc_lpsc_list[13]), PSC_DEV(166, &soc_lpsc_list[14]), PSC_DEV(135, &soc_lpsc_list[15]), diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h index a598607ead..4f4c8bba1d 100644 --- a/include/environment/ti/boot.h +++ b/include/environment/ti/boot.h @@ -12,7 +12,8 @@ #include <linux/stringify.h> #ifndef CONSOLEDEV -#define CONSOLEDEV "ttyS2" +// #define CONSOLEDEV "ttyS2" +#define CONSOLEDEV "ttyS4" #endif #ifndef PARTS_DEFAULT diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h index 97bd7c1fd7..70004fbb79 100644 --- a/include/configs/am62x_evm.h +++ b/include/configs/am62x_evm.h @@ -129,9 +129,9 @@ "setenv name_fdt k3-am62x-lp-sk.dtb; fi;" \ "setenv fdtfile ${name_fdt}\0" \ "name_kern=Image\0" \ - "console=ttyS2,115200n8\0" \ + "console=ttyS4,115200n8\0" \ "args_all=setenv optargs ${optargs} " \ - "earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}\0" \ + "earlycon=ns16550a,mmio32,0x02820000 ${mtdparts}\0" \ "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" /* U-Boot MMC-specific configuration */
thanks,
siva.