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.

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. 

  • Hi Bin,

    My mistake, the path in the above dtso is correct. I was doing unrelated testing that caused the warning.

    So to recap the following dtso worked for enabling uart5 on expansion connector J3.

    /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 = "/bus@f0000/serial@2850000";
        };
    };

    here is the confirmation of the port 

    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:69575 rx:1320 RTS|DTR|DSR
    3: uart:unknown port:00000000 irq:0
    4: uart:unknown port:00000000 irq:0
    5: uart:8250 mmio:0x02850000 irq:240 tx:230 rx:230 RTS|DTR|DSR
    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 did find the path to confirm uart5 in the location you mentioned. 

    /sys/firmware/devicetree/base/bus@f0000

    we see serial@2850000

    root@sk-am62-sip:/sys/firmware/devicetree/base/bus@f0000# ls
    '#address-cells'            ecc@25010000                   phandle          spi@20110000
     audio-controller@2b00000   esm@420000                     phy@30110000     spi@20120000
     audio-controller@2b10000   ethernet@8000000               pinctrl@f4000    spinlock@2a000000
     audio-controller@2b20000   gpio@600000                    pruss@30040000   sram@70000000
     bootph-all                 gpio@601000                    pwm@23000000     system-controller@44043000
     bus@100000                 gpu@fd00000                    pwm@23010000     ticsi2rx@30102000
     bus@4000000                i2c@20000000                   pwm@23020000     timer@2400000
     bus@48000000               i2c@20010000                   pwm@23100000     timer@2410000
     bus@b00000                 i2c@20020000                   pwm@23110000     timer@2420000
     bus@fc00000                i2c@20030000                   pwm@23120000     timer@2430000
     can@20701000               interrupt-controller@1800000   ranges           timer@2440000
     compatible                 interrupt-controller@a00000    serial@2800000   timer@2450000
     counter@23200000           mailbox@29000000               serial@2810000   timer@2460000
     counter@23210000           mailbox@43600000               serial@2820000   timer@2470000
     counter@23220000           memory-controller@3b000000     serial@2830000   watchdog@e000000
     crc@30300000               mmc@fa00000                    serial@2840000   watchdog@e010000
     crypto@40900000            mmc@fa10000                    serial@2850000   watchdog@e020000
     dss@30200000               mmc@fa20000                    serial@2860000   watchdog@e030000
     dwc3-usb@f900000           mux-controller@a40000         '#size-cells'     watchdog@e0f0000
     dwc3-usb@f910000           name                           spi@20100000
    

    Thank you again for taking the time to help with this issue!

  • Glad the issue is resolved. Thanks for sharing the details. 

  • Hi Bin Liu,

    I still get the following warning but everything seems to work just fine as expected. 

    I am using PSDK 10x on Armbian which was made on PSDK 11X. not sure if that is the cause. But in your experience, these warnings should not be there, correct? 

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

  • Hi, I am out of office for a week, please expect delayed response.

  • No worries. Might delete this follow up since the issue is resolved but was just curious. 

  • Hi David,

    This aliases warning message can be ignored. You only see it if you just compile this dtbo itself:

    $ make ARCH=... CROSS_COMPILE=... ti/k3-am625--sk-uart5.dtbo

    You won't see the message if you compile the entire kernel devicetree:

    $ make ARCH=... CROSS_COMPILE=... dtbs