Other Parts Discussed in Thread: DA8XX
Hi Ti,
I'm using SDK 07_01_00_18 and trying to write some sample code to read/write GPIO in Uboot.
I follow another thread to read the GPIO1_25 or GPIO1_67 on AM65x SR1.0 EVM board, but it always return error message.
The thread is this one:
.
According to the thread, I modify k3-am654-base-board.dts by adding the code below:
&main_pmx0 {
.
.
main_gpio1_pins_default: main-gpio1-pins-default {
pinctrl-single,pins = <
//AM65X_IOPAD(0x028c, PIN_INPUT, 7) /* (Y26)GPIO1_67 */
AM65X_IOPAD(0x01E4, PIN_OUTPUT, 7) /* (Y26)GPIO1_25 */
>;
};
};
&main_gpio1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_gpio1_pins_default>;
};
&sdhci0 {
//usb5v-gpios = <&main_gpio1 67 GPIO_ACTIVE_HIGH>;
usb5v-gpios = <&main_gpio1 25 GPIO_ACTIVE_HIGH>;
};
And also modiify k3-am65-main.dtsi:
&cbass_main {
.
.
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,dm-spl;
};
Then, I hook my code in am654_sdhci.c, but always get error.
struct gpio_desc desc;
err = gpio_request_by_name(dev, "usb5v-gpios", 0, &desc, GPIOD_IS_OUT);
if(err)
printf("request usb5v-gpios failed !! \n");
ret = dm_gpio_get_value(&desc);
if(err)
printf("get usb5v-gpios value failed !! \n");
Is there anything wrong?
Please help to look into this.
Thanks.
Eric