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.

Linux/PROCESSOR-SDK-AM437X: GPIO configuration in device tree

Part Number: PROCESSOR-SDK-AM437X

Tool/software: Linux

I am working on U-boot. And I have a gpio5 defined in the dts file as following:

&gpio5 {
  pinctrl-names = "default";
  status = "okay";
  pinctrl-0 = <&gpio5_mux_pins>;
  ti,no-reset-on-init;

  p11 {
  gpio-hog;
  gpios = <11 GPIO_ACTIVE_LOW>;
  output-high;
  line-name = "led1";
  };

};

and the gpio5_mux_pins defined in dts file as:

gpio5_mux_pins: gpio5_mux_pins {
  pinctrl-single,pins = <
  /* GPIO 5_11 to yellow LED */
  0x244(PIN_OUTPUT_PULLUP | MUX_MODE7)
  >;
};

And in my code, I have 

err = dm_gpio_lookup_name("led1", gpio);
if (err) {
  printf("gpio ret=%d\n", err);
  return err;
}

the dm_gpio_lookup_name() always return -22.

Why it does not find the "led1"?

  • Hi Zhiwei,

    Do you use AM437x TI PSDK? If yes, which version?

    Do you use AM437x TI board (EVM, SK, ICE) or custom board?

    Regards,
    Pavel
  • Zhiwei,

    For using LEDs with AM437x GPIO pins in u-boot, I would suggest you to align with AM437x SK board and its DTS file:

    am437x-sk-evm.dts

    leds {
    compatible = "gpio-leds";

    pinctrl-names = "default";
    pinctrl-0 = <&leds_pins>;

    led@3 {
    label = "am437x-sk:blue:usr3";
    gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>; /* Bank 5, pin 3 */
    default-state = "off";
    };

    leds_pins: leds_pins {
    pinctrl-single,pins = <
    0x22c (PIN_OUTPUT | MUX_MODE7) /* uart3_txd.gpio5_3 */

    Regards,
    Pavel
  • Zhiwei,

    If you have no more questions related to the subject, please close/verify/resolve this thread.

    Regards,
    Pavel