AM4378: Kernel hang problem with uart5

Part Number: AM4378
Other Parts Discussed in Thread: AM4372, TPS65218

Hello,

I'm currently trying to port linux kernel on custom board based AM437x-gp-evm.

(Using ti-processor-sdk-linux-am437x-evm-11.02.05.02-Linux-x86-Install.bin)

The kernel was built using the command below.

////////////////

make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" distclean
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config

make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" -j$(nproc) zImage ti/omap/am437x-custom.dtb

////////////////

 

However, when I add uart5 to the dts file and boot, it stops after the log shows "Kernel starting"
Without uart5, it has no problem.

Below is the dts file(am437x-custom.dts)

// DTS file

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/
 */

/* AM437x GP EVM */

/dts-v1/;

#include "am4372.dtsi"
#include <dt-bindings/pinctrl/am43xx.h>
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/gpio/gpio.h>

/ {
    model = "EDGER_LCD_MainPCB (Minimal)";
    compatible = "custom,edger-lcd", "ti,am4372", "ti,am43";

    chosen {
        stdout-path = &uart0;
    };

    /* Fixed 32k RTC clock from BAT */
    clk_32k_rtc: clk_32k_rtc {
        #clock-cells = <0>;
        compatible = "fixed-clock";
        clock-frequency = <32768>;
    };
};

&am43xx_pinmux {
    pinctrl-names = "default";

    i2c0_pins: i2c0_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0x988, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* i2c0_sda */
            AM4372_IOPAD(0x98c, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* i2c0_scl */
        >;
    };

    uart0_pins: uart0_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* uart0_rxd */
            AM4372_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | SLEWCTRL_FAST | MUX_MODE0)  /* uart0_txd */
        >;
    };
    
    /* Tracer 1 */
    uart5_pins: uart5_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0x908, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE3)                /* uart5_rxd.uart5_rxd */
            AM4372_IOPAD(0x944, PIN_OUTPUT_PULLDOWN | SLEWCTRL_FAST | MUX_MODE3)     /* uart5_txd.uart5_txd */
        >;
    };
};

&i2c0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins>;
    clock-frequency = <100000>;

    tps65218: tps@24 {
        compatible = "ti,tps65218";
        reg = <0x24>;
        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* NMIn */
        interrupt-controller;
        #interrupt-cells = <2>;

        dcdc1: regulator-dcdc1 {
            regulator-name = "vdd_core";
            regulator-min-microvolt = <1100000>;
            regulator-max-microvolt = <1100000>;
            regulator-boot-on;
            regulator-always-on;
        };

        dcdc2: regulator-dcdc2 {
            regulator-name = "vdd_mpu";
            regulator-min-microvolt = <1325000>;
            regulator-max-microvolt = <1325000>;
            regulator-boot-on;
            regulator-always-on;
        };

        dcdc3: regulator-dcdc3 {
            regulator-name = "vdd_ddr";
            regulator-min-microvolt = <1500000>;
            regulator-max-microvolt = <1500000>;
            regulator-boot-on;
            regulator-always-on;
        };

        dcdc5: regulator-dcdc5 {
            regulator-name = "v1_0bat";
            regulator-min-microvolt = <1000000>;
            regulator-max-microvolt = <1000000>;
            regulator-boot-on;
            regulator-always-on;
        };

        dcdc6: regulator-dcdc6 {
            regulator-name = "v1_8bat";
            regulator-min-microvolt = <1800000>;
            regulator-max-microvolt = <1800000>;
            regulator-boot-on;
            regulator-always-on;
        };

        ldo1: regulator-ldo1 {
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
            regulator-boot-on;
            regulator-always-on;
        };
    };
};

&uart0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart0_pins>;
};

&uart5 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&uart5_pins>;
};

&cpu {
    cpu0-supply = <&dcdc2>;
};

&rtc {
    clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
    clock-names = "ext-clk", "int-clk";
    status = "okay";
};

//&mac_sw {
//    status = "disabled";  /* Disable Ethernet to free mii/rmii pins for UART5 */
//};

 

What could be the problem?

  • Hi,

    Please add "earlycon=ns16550a,mmio32,0x44e09000" to U-Boot bootargs to see if kernel print any message after "Starting kernel...".

  • Hello,

    I add the "earlycon=ns16550a,mmio32,0x44e09000" to U-boot bootargs, but nothing comes out except "Starting kernel..."

  • Hi,

    If you can rebuild the entire kernel, the following defconfig patch should fix the issue. Please ensure you update the rebuilt kernel zImage and modules into your root filesystem too.

    diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
    index bdbbfbdac72a..05d4b2134062 100644
    --- a/arch/arm/configs/multi_v7_defconfig
    +++ b/arch/arm/configs/multi_v7_defconfig
    @@ -357,8 +357,8 @@ CONFIG_INPUT_STPMIC1_ONKEY=y
     CONFIG_SERIO_AMBAKMI=y
     CONFIG_SERIAL_8250=y
     CONFIG_SERIAL_8250_CONSOLE=y
    -CONFIG_SERIAL_8250_NR_UARTS=5
    -CONFIG_SERIAL_8250_RUNTIME_UARTS=5
    +CONFIG_SERIAL_8250_NR_UARTS=6
    +CONFIG_SERIAL_8250_RUNTIME_UARTS=6
     CONFIG_SERIAL_8250_EXTENDED=y
     CONFIG_SERIAL_8250_MANY_PORTS=y
     CONFIG_SERIAL_8250_ASPEED_VUART=m

    If you don't want to rebuild the entire kernel, the following hack in your am437x-custom.dts should work too.

    +        aliases {
    +               serial1 = &uart5;
    +               serial5 = &uart1;
    +        };

  • Hi,

    After rebuilding the kernel as you told me, it works well!
    Thanks,