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.

TDA4VM-Q1: How to get gpio status on TDA4 uboot?

Part Number: TDA4VM-Q1
Other Parts Discussed in Thread: TDA4VM

Hello,

I want to get the status of gpio in UBOOT

But it's always getting 0,I'm pretty sure the voltage on this gpio is 3.3V

Is there something wrong with my configuration?

  • Hi,

    Can you read out the value of PADCONFIG register: 0x00011C0D0

    U-Boot numbering is slightly different.

    You can check the status of all the GPIOs from U-Boot command prompt using:

    gpio status -a

    - Keerthy

  • Hello,Keerthy

    This is the result of running in uboot,It seems that my configuration does not take effect,

    How to get the status of gpio in code?

  • Hi,

    Can you refer the file in U-boot folder: "board/ti/j721e/evm.c"

    detect_enable_hyperflash function.

    Best Regards,
    Keerthy

  • Hello,Keerthy

    This is my code, but still no success..

    Or is there any other way in uboot?

  • Hi Wang,

    The first thing we need to ensure is that: 

    Can you read out the value of PADCONFIG register: 0x00011C0D0

    What is the value?

    - Keerthy

  • Hello Keerthy,

    I want to modify one gpio value in uboot. GPIO0_127. Belongs to main domain.

    Using TDA4VM Eval board.

    What pin number I should use to modify this gpio.

    If I give gpio set/clear 211 its throwing warning as "Warning: value of pin is still 0"

    Please help me with this.

    Thank you,

    Best Regards,

    Lakshmi shetty

  • Hi Lakshmi Shetty,

    GPIO0_127 comes out on the pad AC4.

    md 0x11c200 0x1

    This should give the pinmux setting for GPIO0_127. Make sure that it is set to GPIO0_127 mode. Value should be 0x08050007.
    If not then it will not toggle the physical pin.

    - Keerthy

  • Hello Keerthy,

    When I am reading this ram address, getting the vale as 0x08214007.

    How can I proceed?

    Thanks in advance,

    Lakshmi Shetty

  • Hello Keerthy,

    I tried to write this register value in uboot command prompt(using mw 0x11C200 0x08050007).

    Able to change to gpio value using set/clear in uboot command prompt.

    If I need to do this in uboot code, is there any reference?

    Thanks in advance,

    Lakshmi Shetty

  • Hi Lakshmi,

    Reference: arm/dts/k3-j721e-common-proc-board.dts


    vdd_sd_dv_alt: gpio-regulator-TLV71033 {
    compatible = "regulator-gpio";
    pinctrl-names = "default";
    pinctrl-0 = <&vdd_sd_dv_alt_pins_default>;
    regulator-name = "tlv71033";
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <3300000>;
    regulator-boot-on;
    u-boot,dm-spl;
    vin-supply = <&vsys_5v0>;
    gpios = <&main_gpio0 117 GPIO_ACTIVE_HIGH>;
    states = <1800000 0x0
    3300000 0x1>;
    };


    vdd_sd_dv_alt_pins_default: vdd_sd_dv_alt_pins_default {
    pinctrl-single,pins = <
    J721E_IOPAD(0x1d8, PIN_INPUT, 7) /* (W4) SPI1_CS1.GPIO0_117 */
    >;
    u-boot,dm-spl;
    };

    And your driver should be able to access the gpio like:

    gpio = &dev_pdata->gpio;
    ret = gpio_request_by_name(dev, "gpios", 0, gpio, flags);
    if (ret)
    debug("regulator gpio - not found! Error: %d", ret);

    drivers/power/regulator/gpio-regulator.c

    Closing this thread.

    - Keerthy