SK-AM62-SIP: Enabling UART5 from device tree compilation issue

Part Number: SK-AM62-SIP
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello All,

I am mainly having issues compiling .dtso files into .dtbo

Any advice would be greatly appreciated. 

The goal is to enable the UART5 pins on the expansion connector. 

Hardware: AM62SIP EVM

PSDK: ti-processor-sdk-linux-am62xxsip-evm-10.01.10.04-Linux-x86-Install.bin

I added k3-am62x-sk-uart5.dtso to arch/arm64/boot/dts/ti/

The file contains 

/dts-v1/;
/plugin/;

#include <dt-bindings/pinctrl/k3.h>
#include <dt-bindings/gpio/gpio.h>

/* AM62x SK / SiP SK: 40-pin header UART5 on J3:
 *   Pin 8  -> EXP_UART5_TXD (SoC ball E15)
 *   Pin 10 -> EXP_UART5_RXD (SoC ball C15)
 * MUST be mode 1 (TI E2E correction).
 */

&main_pmx0 {
    user_exp_uart5_pins_default: user-exp-uart5-pins-default {
        pinctrl-single,pins = <
            AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* E15 -> UART5_TXD */
            AM62X_IOPAD(0x01d8, PIN_INPUT,  1) /* C15 -> UART5_RXD */
        >;
    };
};

&main_uart5 {
    pinctrl-names = "default";
    pinctrl-0 = <&user_exp_uart5_pins_default>;
    status = "okay";
};


&{/} {
    aliases { serial5 = &main_uart5; };
}

/* power the 40-pin 3V3 rail 
&main_i2c1 {
    gpio@22 { /* TCA6424 at 0x22 *\/
        p05-hog {
            gpio-hog;
            gpios = <5 GPIO_ACTIVE_HIGH>; /* EXP_PS_3V3_EN *\/
            output-high;
            line-name = "EXP_PS_3V3_EN";
        };
    };
};
*/

Also added the following to the make file in arch/arm64/boot/dts/ti/

dtb-$(CONFIG_ARCH_K3) += k3-am62x-sk-uart5.dtbo



Ran the following export and source 

export SDK_INSTALL_DIR=~/Desktop/8-11-processor-SDK-10x

source "$SDK_INSTALL_DIR/linux-devkit/environment-setup-aarch64-oe-linux"

In Linux kernel directory 

  • cd "$SDK_INSTALL_DIR/board-support/ti-linux-kernel-6.6.58+git-ti"

I ran

make clean

make dtbs 



make dtbs , gets the following error: 

arch/arm64/boot/dts/ti/k3-am62x-sk-uart5.dtso:4:10: fatal error: dt-bindings/pinctrl/k3.h: No such file or directory

    4 | #include <dt-bindings/pinctrl/k3.h>

      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~

compilation terminated.

make[3]: *** [scripts/Makefile.lib:426: arch/arm64/boot/dts/ti/k3-am62x-sk-uart5.dtbo] Error 1

make[2]: *** [scripts/Makefile.build:480: arch/arm64/boot/dts/ti] Error 2

make[1]: *** [/home/davidsober/Desktop/8-11-processor-SDK-10x/board-support/ti-linux-kernel-6.6.58+git-ti/Makefile:1398: dtbs] Error 2

make: *** [Makefile:234: __sub-make] Error 2




Ideally, we could compile the dtbs to dtbo so that we can place the file in dtb directory in boot partition and enable it with uEnv.txt 

But if this approach is not ideal and we should instead focus on patching the entire device tree then please advise on this. 

  • I understand that would likely require a different post however. 



Thank you for taking the time.

  • Follow up. For the missing header file  #include <dt-bindings/pinctrl/k3.h> is this supposed to be generated by using the sysconfig tool? 

  • Hi David,

    For the missing header file  #include <dt-bindings/pinctrl/k3.h> is this supposed to be generated by using the sysconfig tool? 

    Please refer to other k3-am62*.dtso files in kernel tree, the file to be included should be:

    #include "k3-pinctrl.h"

    Ran the following export and source 

    export SDK_INSTALL_DIR=~/Desktop/8-11-processor-SDK-10x

    source "$SDK_INSTALL_DIR/linux-devkit/environment-setup-aarch64-oe-linux"

    In Linux kernel directory 

    • cd "$SDK_INSTALL_DIR/board-support/ti-linux-kernel-6.6.58+git-ti"

    I ran

    make clean

    make dtbs 

    Instead of these steps, the SDK provides a simple way to compile kernel devicetree - at the SDK top level directory (not within kernel src), run command:

    $ make linux_dtbs

  • Hello Bin Lui, thank for looking into this. 

    I removed the #includes I had and replaced them with the one you mentioned. Also, make linux-dtbs is helpful and faster than the steps I had. 

    The following was built with make linux-dtbs

    /dts-v1/;
    /plugin/;
    
    #include "k3-pinctrl.h"
    
    &main_pmx0 {
        user_exp_uart5_pins_default: user-exp-uart5-pins-default {
            pinctrl-single,pins = <
                AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* E15 -> UART5_TXD */
                AM62X_IOPAD(0x01d8, PIN_INPUT,  1) /* C15 -> UART5_RXD */
            >;
        };
    };
    
    &main_uart5 {
        pinctrl-names = "default";
        pinctrl-0 = <&user_exp_uart5_pins_default>;
        status = "okay";
    };
    
    /*
    &{/} {
        aliases { serial5 = &main_uart5; };
    }
    */
    
    /* power the 40-pin 3V3 rail 
    &main_i2c1 {
        gpio@22 { /* TCA6424 at 0x22 *\/
            p05-hog {
                gpio-hog;
                gpios = <5 GPIO_ACTIVE_HIGH>; /* EXP_PS_3V3_EN *\/
                output-high;
                line-name = "EXP_PS_3V3_EN";
            };
        };
    };
    */
    

    I commented out the alias since that was producing syntax errors. 

    After moving the .dtbo to dtb in boot/dtb/ti/ and adding ti to uEnv.txt Linux booted but I do not see the uart5 as active as shown here: 

    root@sk-am62-sip:~# cat /proc/tty/driver/serial 
    serinfo:1.0 driver revision:
    0: uart:unknown port:00000000 irq:0
    1: uart:unknown port:00000000 irq:0
    2: uart:8250 mmio:0x02800000 irq:238 tx:23461 rx:153 RTS|DTR|DSR
    3: uart:unknown port:00000000 irq:0
    4: uart:unknown port:00000000 irq:0
    5: uart:unknown port:00000000 irq:0
    6: uart:unknown port:00000000 irq:0
    7: uart:unknown port:00000000 irq:0
    8: uart:unknown port:00000000 irq:0
    9: uart:unknown port:00000000 irq:0
    10: uart:unknown port:00000000 irq:0
    11: uart:unknown port:00000000 irq:0
    

    I believe it is not active because I did not assign an alias to uart5 as mentioned in this post 

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1372383/sk-am62-how-to-enable-userexpension-uart?utm_source=chatgpt.com 

    Yes so at this point it should just be a syntax issue. I just need to enable the alias section without a syntax error. Will update soon..

  • Hi Bin Liu

    Update: I just need to find the correct path for serial5 alias

    I compiled the following dtso

    /dts-v1/;
    /plugin/;
    
    
    #include "k3-pinctrl.h"
    
    &main_pmx0 {
        user_exp_uart5_pins_default: user-exp-uart5-pins-default {
            pinctrl-single,pins = <
                AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* E15 -> UART5_TXD */
                AM62X_IOPAD(0x01d8, PIN_INPUT,  1) /* C15 -> UART5_RXD */
            >;
        };
    };
    
    &main_uart5 {
        pinctrl-names = "default";
        pinctrl-0 = <&user_exp_uart5_pins_default>;
        status = "okay";
    };
    
    
    &{/} {
        aliases {
            /* UART-5 lives at /bus@f0000/serial@2850000 in k3-am62-main.dtsi */
            serial5 = "/bus@f0000/serial@2850000";
        };
    };
    
    
    /*
    &{/} {
        aliases { serial5 = &main_uart5; 
        };
    };
    */
    

    The results show the path I used for the alias is wrong

      DTC     arch/arm64/boot/dts/ti/k3-am62x-sk-uart5.dtbo
    arch/arm64/boot/dts/ti/k3-am62x-sk-uart5.dtso:26.9-47: Warning (alias_paths): /fragment@2/__overlay__/aliases:serial5: aliases property is not a valid node (/bus@f0000/serial@2850000)
    

    Where is one able to find the correct path for this alias?

    I see under the k3-am62* examples  

    k3-am62a7-sk-ethernet-dco1.dtso

    has the following snippet

    &{/} {
    
        aliases {
    
            ethernet1 = "/bus@f0000/ethernet@8000000/ethernet-ports/port@2";
    
        };
    
    };

    From the example, I see we need to find the correct path to complete a correct alias. 

    Is the path generated from sysconfig tool?

    Thank you again for taking the time. 

  • Hi David,

    there are multiple ways to find the path. I guess the easy one for you is to search for *main_uart5* on your board under /sys/firmware/devicetree/fdt/base/ with your uart5 overlay loaded. 

    sorry I am out of office and don’t have access to my EVM and kernel code to tell you the exact path.