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-AM64B: GPIO unnamed label

Part Number: SK-AM64B
Other Parts Discussed in Thread: TPIC2810

i am trying to access the gpio pins through terminal itself. i am using gpio tools like gpiodetect and gpioinfo to access the pins but gpiochip 2 and 3 all that showing unnamed, or we can say not labeled so i am not able to access the gpio pins. I request you to help me with the same. Below is the terminal output for gpioinfo : 

gpiochip2 - 87 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high

I am not able to access these pins and I don't have knowledge of which pin is connect to which header.

In gpiochip1, the pins are labeled so i'm able to access them.
gpiochip1 - 8 lines:
line 0: "GPIO_CPSW2_RST" unused input active-high
line 1: "GPIO_CPSW1_RST" unused input active-high
line 2: "PRU_DETECT" unused input active-high
line 3: "MMC1_SD_EN" "fixed-regulator-sd" output active-high [used]
line 4: "VPP_LDO_EN" unused input active-high
line 5: "RPI_PS_3V3_En" unused input active-high
line 6: "RPI_PS_5V0_En" unused input active-high
line 7: "RPI_HAT_DETECT" unused input active-high


  • Hi Debashis,

    Please tell me what SDK version you are using and which pins you are trying to use.

    You can use the pins even if they are unlabeled. If you are unable to, then the device tree may have an issue. Please share the changes you made to dts.

    If you would like to label a pin, you can set all the names in a gpiochip using gpio-line-names. An example of this can be see here under section 2) gpio-controller nodes: git.ti.com/.../gpio.txt. gpio-line-names can be placed with the reference to the pins in the device tree.

    -Anshu

  • I am using 

    PROCESSOR-SDK-LINUX-RT-AM64X  Processor SDK RT-Linux for AM64x  version 9.00.00

    but when i do

    find / -name *.dts

    i didn't get any output but in /boot i get some binary file of device tree

    Image                                                 fitImage-5.10.168-g2c23e6c538                                                 k3-am642-evm-nand.dtbo
    Image-5.10.168-g2c23e6c538          k3-am642-evm-icssg1-dualemac-mii.dtbo                               k3-am642-evm.dtb
    fitImage                                             k3-am642-evm-icssg1-dualemac.dtbo                                      k3-am642-sk.dtb

    here i tried to get the gpio pin but i dont know which gpio pin indicates the line 86 of gpiochip first can you tell me how to know these thing

    here i tried to make the pin HIGH and Read it but I am getting same ZERO

    root@am64xx-evm:~# gpioinfo 2

    ..................................................................

    line 86: unnamed unused input active-high
    root@am64xx-evm:~# gpioget 2 86    //hear i try to read the pin
    0
    root@am64xx-evm:~# gpioset 2 86=1   //hear i try to make it high
    root@am64xx-evm:~# gpioget 2 86       // hear again i am reading the pin
    0
    root@am64xx-evm:~# gpioset 2 86=0
    root@am64xx-evm:~# gpioget 2 86
    0

    can i do in old method /sys/class/gpio hear we have to export and do the High and Low operation as i already done with raspberry pi but for that we required BCM number to export the pin as respect to which gpio and in raspi we are using command (gpio readall) to get the output .

    But i read some documentation they are saying its deprecated so i left it and following the above one.

    can you tell me how to know which line is linked with which gpio pin of skam64 processor as you said that even if it unnamed also it will work.

  • I convert the dtb to dts file then tried to give label, but that pin is set to used and when I was trying to access showing busy interface. I am attaching the code which I changed, the changes are in bold letters.
    Can you guide me to change to dts file so that I can access the gpio pins properly and how to determine which gpio pin is connected to which pin of processor.

    gpio@600000 {
    compatible = "ti,am64-gpio\0ti,keystone-gpio";
    reg = <0x00 0x600000 0x00 0x100>;
    gpio-controller;
    #gpio-cells = <0x02>;
    interrupt-parent = <0x14>;
    interrupts = <0xbe 0xbf 0xc0 0xc1 0xc2 0xc3>;
    interrupt-controller;
    #interrupt-cells = <0x02>;
    ti,ngpio = <0x57>;
    ti,davinci-gpio-unbanked = <0x00>;
    power-domains = <0x02 0x4d 0x01>;
    clocks = <0x03 0x4d 0x00>;
    clock-names = "gpio";
    pinctrl-names = "default";
    pinctrl-0 = <0x15>;
    phandle = <0x12>;

    gpio0-63 {
    gpio-hog;
    gpios = <0x3f 0x00>;
    output-high;
    line-name = "btuart_rts_sel";
    };

    gpio0-85 {
    gpio-hog;
    gpios = <0x55 0x00>;
    output-high;
    line-name = "GPIO0_85";
    };

    gpio0-86 {
    gpio-hog;
    gpios = <0x56 0x00>;
    output-high;
    line-name = "GPIO0_86";
    };

    };

  • Hi Debashis,

    The pins you are using (GPIO0_85 and GPIO0_86) are not accessible from the User Expansion Connector. The User Expansion Connector is how you can physically connect to the pins and can be found in the schematic for the device.

    To find the schematic for SK-AM64B, go to this link: https://www.ti.com/tool/SK-AM64B#design-files. Download the design files zip file and open 'PROC100A(002)_SCH.pdf'. On page 26 of the schematic, there is a section named User Expansion Connector. This will show the 40 pins you can access on the board.

    But i read some documentation they are saying its deprecated

    You are correct. For SDK 9.0, /sys/class/gpio is deprecated.

    can you tell me how to know which line is linked with which gpio pin of skam64 processor

    Please share the output of gpiodetect. Generally, gpio0 will have an address of 600000.gpio and gpio1 will have 601000.gpio. The line number is directly related to the pin number. When you use 86 in the commands you showed, it is trying to use pin 86.

    Can you guide me to change to dts file

    The file you should be changing is 'k3-am642-sk.dts' for this starter kit. You need to add the pin instantiation under '&main_pmx0'. Then you need to add a reference to the pins. There is another thread that talked about this: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1246530/am6412-gpio-write-operation-not-done .

    In this reference to the pins, you can add gpio-line-names.

    -Anshu

  • https://drive.google.com/drive/folders/1XtSk7d_WYAv1ELtkEVwiVQui2dhisCQN?usp=sharing


    You can see the above link to check the device tree .txt file of k3-am642-sk.dtb. I could not find '&main_pmx0' tag there, so I added the following lines to access RPI GPIO0 32. However, while compiling it to dtb file it gave compilation error.

    &main_pmx0 {
    	mygpio1_pins_default: mygpio1-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x0084, PIN_OUTPUT, 7) /* (P16) GPMC0_ADVn_ALE.GPIO0_32 */
    		>;
    	};
    };



    Anshu Madwesh said:
    Please share the output of gpiodetect.


    root@am64xx-evm:~# gpiodetect
    gpiochip0 [omap-gpmc] (2 lines)
    gpiochip1 [1-0070] (8 lines)
    gpiochip2 [600000.gpio] (87 lines)
    gpiochip3 [601000.gpio] (88 lines)
    gpiochip4 [tpic2810] (8 lines)

    My case gpiochip2 and 3 are those gpio0 and gpio1 i saw the datasheet of am64x processor. I want to access GPIO0_32 which is connected to User header of RPI_GPIO0_32 connected to ARM P16 pin. I tried to set the pin high using following commands, but it remain unchanged. 

    root@am64xx-evm:~# gpioset 2 32=1         
    root@am64xx-evm:~# gpioset -m wait 32=1     // i tried this also and check in multimeter voltage is 0.71v only before that RPI 3.3 and 5 v i make output in                                                                                   // gpiochip1

    root@am64xx-evm:~# gpioinfo 2                     
     line  32:      unnamed       unused  output  active-high

  • Hi Debashis,

    Can you show the code through text in this thread instead of Google Drive?

    However, while compiling it to dtb file it gave compilation error

    Do you have any more information about the error you are getting?

    -Anshu

  • As you said previously I followed the thread and its working fine but i want to  confirm what ever i have done is a correct way to configure the pins.


    under the &main_pmx0:

    mygpio1_pins_default: mygpio1-pins-default {
    pinctrl-single,pins = <
    AM64X_IOPAD(0x0084, PIN_OUTPUT, 7) /* (P16) RPI_GPIO032 */
    AM64X_IOPAD(0x00ac, PIN_OUTPUT, 7) /* (R20) RPI_GPIO042 */
    >;
    };

    and at the end of the file : 

    &main_gpio0{
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&mygpio1_pins_default>;
    gpio-line-names = "A","B","C","D","E","F","G","H";
    };

    Also, 'gpio-line-names' starts naming from line 0. If I want to rename a particular line, is there another way to do it?

  • Actually we have downloaded the ti-processor-sdk-linux-rt-am64xx-evm-09.00.00.03-Linux-x86-Install.bin from the site then we change the makefile to only compile the dts files and replace the dtb file in boot of SKAM64B board. Is this is the right way to do it.

  • Hi Debashis,

    i want to  confirm what ever i have done is a correct way to configure the pins

    From what you provided, it looks correct.

    If I want to rename a particular line, is there another way to do it?

    I am not aware of any other way to do it. For pins to remain unnamed, use an empty string. Its very tedious, but it does work.

    &main_gpio0{
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&mygpio1_pins_default>;
        gpio-line-names = "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "", "", "", "","",
                          "","","GPIO0_42 Name";
    };

    makefile to only compile the dts files and replace the dtb file in boot of SKAM64B board

    You can use the default Makefile or run the commands individually. See the information here about the Makefile: https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM64X/09_00_00_03/exports/docs/linux/Overview/Top_Level_Makefile.html . Also see the information about compiling and installing here: https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM64X/09_00_00_03/exports/docs/linux/Foundational_Components_Kernel_Users_Guide.html#compiling-the-sources


    This is the way I recommend to compile and install since its documented, but if the changes you made to the Makefile work, then that is fine.

    -Anshu

  • Hi Anshu 
    Now When I trying to access the PRU Headers i cannot able to access but when i tested before its working fine can you tell me please what's the problem.

    And i am not getting any compiling error also.

    mygpio2_pins_default: mygpio2-pins-default {
    pinctrl-single,pins = <
    AM64X_IOPAD(0x0160, PIN_OUTPUT, 7) /* (Y1) PRG0_PRU0_GPO0.GPIO1_0 */
    AM64X_IOPAD(0x0164, PIN_OUTPUT, 7) /* (R4) PRG0_PRU0_GPO1.GPIO1_1 */
    AM64X_IOPAD(0x0168, PIN_OUTPUT, 7) /* (U2) PRG0_PRU0_GPO2.GPIO1_2 */
    AM64X_IOPAD(0x016c, PIN_OUTPUT, 7) /* (V2) PRG0_PRU0_GPO3.GPIO1_3 */
    AM64X_IOPAD(0x0170, PIN_OUTPUT, 7) /* (AA2) PRG0_PRU0_GPO4.GPIO1_4 */
    AM64X_IOPAD(0x0174, PIN_OUTPUT, 7) /* (R3) PRG0_PRU0_GPO5.GPIO1_5 */
    AM64X_IOPAD(0x0178, PIN_OUTPUT, 7) /* (T3) PRG0_PRU0_GPO6.GPIO1_6 */
    AM64X_IOPAD(0x017c, PIN_OUTPUT, 7) /* (T1) PRG0_PRU0_GPO7.GPIO1_7 */
    AM64X_IOPAD(0x0180, PIN_OUTPUT, 7) /* (T2) PRG0_PRU0_GPO8.GPIO1_8 */
    AM64X_IOPAD(0x0184, PIN_OUTPUT, 7) /* (W6) PRG0_PRU0_GPO9.GPIO1_9 */
    AM64X_IOPAD(0x0188, PIN_OUTPUT, 7) /* (AA5) PRG0_PRU0_GPO10.GPIO1_10 */
    AM64X_IOPAD(0x018c, PIN_OUTPUT, 7) /* (Y3) PRG0_PRU0_GPO11.GPIO1_11 */
    AM64X_IOPAD(0x0190, PIN_OUTPUT, 7) /* (AA3) PRG0_PRU0_GPO12.GPIO1_12 */
    AM64X_IOPAD(0x0194, PIN_OUTPUT, 7) /* (R6) PRG0_PRU0_GPO13.GPIO1_13 */
    AM64X_IOPAD(0x0198, PIN_OUTPUT, 7) /* (V4) PRG0_PRU0_GPO14.GPIO1_14 */
    AM64X_IOPAD(0x019c, PIN_OUTPUT, 7) /* (T5) PRG0_PRU0_GPO15.GPIO1_15 */
    AM64X_IOPAD(0x01a0, PIN_OUTPUT, 7) /* (U4) PRG0_PRU0_GPO16.GPIO1_16 */
    AM64X_IOPAD(0x01a4, PIN_OUTPUT, 7) /* (U1) PRG0_PRU0_GPO17.GPIO1_17 */
    AM64X_IOPAD(0x01a8, PIN_OUTPUT, 7) /* (V1) PRG0_PRU0_GPO18.GPIO1_18 */
    AM64X_IOPAD(0x01ac, PIN_OUTPUT, 7) /* (W1) PRG0_PRU0_GPO19.GPIO1_19 */
    AM64X_IOPAD(0x01b0, PIN_OUTPUT, 7) /* (Y2) PRG0_PRU1_GPO0.GPIO1_20 */
    AM64X_IOPAD(0x01b4, PIN_OUTPUT, 7) /* (W2) PRG0_PRU1_GPO1.GPIO1_21 */
    AM64X_IOPAD(0x01b8, PIN_OUTPUT, 7) /* (V3) PRG0_PRU1_GPO2.GPIO1_22 */
    AM64X_IOPAD(0x01bc, PIN_OUTPUT, 7) /* (T4) PRG0_PRU1_GPO3.GPIO1_23 */
    AM64X_IOPAD(0x01c0, PIN_OUTPUT, 7) /* (W3) PRG0_PRU1_GPO4.GPIO1_24 */
    AM64X_IOPAD(0x01c4, PIN_OUTPUT, 7) /* (P4) PRG0_PRU1_GPO5.GPIO1_25 */
    AM64X_IOPAD(0x01c8, PIN_OUTPUT, 7) /* (R5) PRG0_PRU1_GPO6.GPIO1_26 */
    AM64X_IOPAD(0x01cc, PIN_OUTPUT, 7) /* (W5) PRG0_PRU1_GPO7.GPIO1_27 */
    AM64X_IOPAD(0x01d0, PIN_OUTPUT, 7) /* (R1) PRG0_PRU1_GPO8.GPIO1_28 */
    AM64X_IOPAD(0x01d4, PIN_OUTPUT, 7) /* (Y5) PRG0_PRU1_GPO9.GPIO1_29 */
    AM64X_IOPAD(0x01d8, PIN_OUTPUT, 7) /* (V6) PRG0_PRU1_GPO10.GPIO1_30 */
    AM64X_IOPAD(0x01dc, PIN_OUTPUT, 7) /* (W4) PRG0_PRU1_GPO11.GPIO1_31 */
    AM64X_IOPAD(0x01e0, PIN_OUTPUT, 7) /* (Y4) PRG0_PRU1_GPO12.GPIO1_32 */
    AM64X_IOPAD(0x01e4, PIN_OUTPUT, 7) /* (T6) PRG0_PRU1_GPO13.GPIO1_33 */
    AM64X_IOPAD(0x01e8, PIN_OUTPUT, 7) /* (U6) PRG0_PRU1_GPO14.GPIO1_34 */
    AM64X_IOPAD(0x01ec, PIN_OUTPUT, 7) /* (U5) PRG0_PRU1_GPO15.GPIO1_35 */
    AM64X_IOPAD(0x01f0, PIN_OUTPUT, 7) /* (AA4) PRG0_PRU1_GPO16.GPIO1_36 */
    AM64X_IOPAD(0x01f4, PIN_OUTPUT, 7) /* (V5) PRG0_PRU1_GPO17.GPIO1_37 */
    >;
    };

    &main_gpio1{
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&mygpio2_pins_default>;
    };

  • Hi 
    But when i tested the GPIO1 port which is link to user expansion header i can able to access but what i mentioned above is PRU headers is under GPIO2.

    same way i wrote the device tree for gpio1

    mygpio1_pins_default: mygpio1-pins-default {
    pinctrl-single,pins = <
    AM64X_IOPAD(0x0084, PIN_OUTPUT, 7) /* (P16) GPMC0_ADVn_ALE.GPIO0_32 */
    AM64X_IOPAD(0x0090, PIN_OUTPUT, 7) /* (P17) GPMC0_BE0n_CLE.GPIO0_35 */
    AM64X_IOPAD(0x009c, PIN_OUTPUT, 7) /* (Y18) GPMC0_WAIT1.GPIO0_38 */
    AM64X_IOPAD(0x00a0, PIN_OUTPUT, 7) /* (N16) GPMC0_WPn.GPIO0_39 */
    AM64X_IOPAD(0x00a4, PIN_OUTPUT, 7) /* (N17) GPMC0_DIR.GPIO0_40 */
    AM64X_IOPAD(0x00a8, PIN_INPUT, 7) /* (R19) GPMC0_CSn0.GPIO0_41 */
    AM64X_IOPAD(0x00ac, PIN_OUTPUT, 7) /* (R20) GPMC0_CSn1.GPIO0_42 */
    >;
    };

    &main_gpio0{
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&mygpio1_pins_default>;
    gpio-line-names = "A","B","C","D","E","F","G","H";
    };