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.

PROCESSOR-SDK-AM65X: Accessing GPIO pins in U-boot

Part Number: PROCESSOR-SDK-AM65X
Other Parts Discussed in Thread: DA8XX

Hello TI Team,

We are working on a custom platform based on TI's AM65X SOC.

There is a usecase where we need to check GPIO1_57 value in U-boot. But somehow we are not able to access GPIO's from the u-boot.

we have followed a method from one of the TI's previous thread : 

But we are not able to get desired output.

Below are the changes we made in accordance with the above URL.

u-boot/arch/arm/dts/k3-am65-main.dtsi

&cbass_main {

.....

main_i2c3: i2c@2030000 {

....

};

main_gpio1: main_gpio1@601000 {
        compatible = "ti,k2g-gpio", "ti,keystone-gpio";
        reg = <0x0 0x601000 0x0 0x100>;
        gpio-controller;
        #gpio-cells = <2>;
        ti,ngpio = <90>;
        ti,davinci-gpio-unbanked = <0>;
        clocks = <&k3_clks 58 0>;
        clock-names = "gpio";
    };

u-boot/arch/arm/dts/k3-am654-base-board.dts

&main_pmx0 {

main_gpio1_pins_default: main-gpio1-pins-default {
pinctrl-single,pins = <
AM65X_IOPAD(0x0264, PIN_INPUT, 0) /* (W27)GPIO1_57 */
>;
};

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

 


The below is the code that we are using for the accessing the GPIO in u-boot.


tmp = gpio_request(209,"lcd_det"); /*GPIO1_57*/
if(tmp<0)
{
printf("Mistral GPIO_209 Request fail \n");
}

tmp = gpio_direction_input(209);
if(tmp<0)
{
printf("Mistral GPIO_209 direction fail \n");
}
tmp = gpio_get_value(209);
if(tmp<0)
{
printf("Mistral GPIO_209 get_value fail \n");
}

 


We are seeing that the gpio request itself is failing with the above code changes.

By using "md" and "mw" commands in u-boot we are able to read this perticular GPIO.

Requesting your support on this issue that we are facing.

Regards,

Ramakrishna