This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM572x IDK changing debug console in Linux

Dear all,

I'm using the IDK AM572x development board. By default it uses UART3 for serial console.

I'm trying to switch the console to UART1. I've managed to do that in u-boot.

I've also adjusted "console" u-boot env: console=ttyO0,115200n8

board_name=am572x_idk

I've also modified the am57xx-idk-common.dtsi:

-&uart3 {
+&uart1 {
status = "okay";
- interrupts-extended = <&crossbar_mpu GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH
- &dra7_pmx_core 0x248>;
+ interrupts-extended = <&crossbar_mpu GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH
+ &dra7_pmx_core 0x3E0>;
};

I've also removed the led@4 and led@5 nodes (which use the same PINs):

- led@4 {
- label = "status1:green:usr";
- gpios = <&gpio7 23 GPIO_ACTIVE_HIGH>;
- default-state = "off";
- };
-
- led@5 {
- label = "status1:blue:mmc0";
- gpios = <&gpio7 22 GPIO_ACTIVE_HIGH>;
- default-state = "off";
- linux,default-trigger = "mmc0";
- };

The DEBUG_LL is not showing anything:

SD/MMC found on device 0
3572208 bytes read in 235 ms (14.5 MiB/s)
99785 bytes read in 37 ms (2.6 MiB/s)
Booting from mmc0 ...
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8ffe4000, end 8ffff5c8 ... OK

Starting kernel ...

Linux is from TI's SDK:

ti-am572x-idk-sdk/board-support/linux-4.4.19+gitAUTOINC+db0b54cdad-gdb0b54cdad

Any ideas?

  • The software team have been notified. They will respond here.
  • Hi,

    Have you added the pinmux configurations for uart1? In kernel 4.4.19 (which is SDK03.01), this is done in u-boot.

    Also you need to change u-boot/arch/arm/dts/am572x-idk.dtsi:
    chosen {
    stdout-path = &uart3;
    };

    to
    chosen {
    stdout-path = &uart1;
    };

    And also add the uart1 entries as in the kernel dts files (u-boot/arch/arm/dts/am572x-idk.dtsi & u-boot/arch/arm/dts/am57xx-common.dtsi).

    Best Regards,
    Yordan
  • HI,

    UART 1 settings in u-boot:


    --- a/board/ti/am57xx/mux_data.h
    +++ b/board/ti/am57xx/mux_data.h
    @@ -481,8 +481,8 @@ const struct pad_conf_entry core_padconf_array_essential_am572x_idk[] = {
    };

    const struct pad_conf_entry early_padconf[] = {
    - {UART2_CTSN, (M2 | PIN_INPUT_SLEW)}, /* uart2_ctsn.uart3_rxd */
    - {UART2_RTSN, (M1 | PIN_INPUT_SLEW)}, /* uart2_rtsn.uart3_txd */
    + {UART1_RXD, (M0 | PIN_INPUT_SLEW)}, /* */
    + {UART1_TXD, (M0 | PIN_INPUT_SLEW)}, /* */

    diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
    index fc99135..47ad9c3 100644
    --- a/arch/arm/cpu/armv7/omap5/hw_data.c
    +++ b/arch/arm/cpu/armv7/omap5/hw_data.c
    @@ -405,7 +405,7 @@ void enable_basic_clocks(void)
    (*prcm)->cm_l3init_hsmmc2_clkctrl,
    (*prcm)->cm_l4per_gptimer2_clkctrl,
    (*prcm)->cm_wkup_wdtimer2_clkctrl,
    - (*prcm)->cm_l4per_uart3_clkctrl,
    + (*prcm)->cm_l4per_uart1_clkctrl,
    (*prcm)->cm_l4per_i2c1_clkctrl,
    #ifdef CONFIG_DRIVER_TI_CPSW
    (*prcm)->cm_gmac_gmac_clkctrl,
    diff --git a/arch/arm/dts/am572x-idk.dts b/arch/arm/dts/am572x-idk.dts
    index b340551..3054f52 100644
    --- a/arch/arm/dts/am572x-idk.dts
    +++ b/arch/arm/dts/am572x-idk.dts
    @@ -19,7 +19,7 @@
    "ti,dra7";

    chosen {
    - stdout-path = &uart3;
    + stdout-path = &uart1;
    };

    And in U-Boot I do use UART1 now - there is no issue with it.

    The problem is with Linux kernel (its configuration). I've pasted my changes to Kernel DTS (in the previous message), but apparently it is not enough.

    BR,
    Łukasz
  • Hi Łukasz

    Sorry, I've missed one more modification needed:
    #define CONSOLEDEV "ttyO2" ==> modify to match uart1

    in u-boot/include/configs/am57xx_evm.h

    Kernel should take the already configured uart as a debug console.

    Best Regards,
    Yordan
  • Hi,

    No, this is also setup manually with

    setenv console "ttyO0,115200n8"

    U-boot works with UART1.

    There is problem with linux.
    CONFIG_DEBUG_LL has early printk option for 8250_omap.c driver, but I don't know how to adjust it.
  • Hi,

    One more idea - I do have access to UART3 and UART1.

    Is there a way to adjust CONFIG_DEBUG_LL to have UART3 as a debug one?

    BR,
    Łukasz
  • Hi
    Is your problem solved?

    Is console working in Linux?

    Thanks
  • Hi,

    Yes, it all works now.

    BR,
    Łukasz
  • Can you please let me know what was the change for enabling the console in kernel?
  • thanks for reporting that the problem was solved. we really appreciate this input.
  • Hi Rogerio,

    Problem is not solved completely yet. We are able to boot u-boot at uart3 but kernel is not booting at uart3(kernel is booting uart0). Could you please provide the changes required at kernel to make it work at uart3.

    Thanks and Regards
    Deshvir Malik
  • Dear All,

    I don't remember exactly what was the reason (last reply to the post is from Dec 9, 2016).

    One should pay attention to:

    - Early u-boot (spl) pin assignment (UART3)
    - Enabled clocks
    - Change CONSOLEDEV in u-boot and pass proper console= env variable to Linux

    In Linux:
    - Modify stdout-path

    And DEBUG_LL was not working when I checked last time (now I do not it).

    Best regards,
    Łukasz
  • Hi All,

    Thanks for your inputs. We have modified the below code in bootloader at /include/configs/am335x_evm.h
    "init_console=" \
    "if test $board_name = A335_ICE; then "\
    "setenv console ttyO3,115200n8;" \
    "else " \
    "setenv console ttyO3,115200n8;" \
    "fi;\0" \

    After doing this modification, kernel logs are coming at uart3.
    Previously, we only setting console parameter, but above step is mandatory to make the kernel work at uart3.


    Thanks and Regards
    Deshvir Malik