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.

AM5728: GPIO configuration

Part Number: AM5728

Hi All,

   Am trying to use GPIO5_7 pin part of MCASP1 as GPIO output pin. That pin will be on expansion connector P17 pin number 15 of EVM_AM572x.

   Not able to access that pin as GPIO. Is it possible to use that pin as GPIO. Under mux_dat.h that pin already configured by default as gpio5_7

    

In dts file linux side I added gpio-controller like
mcasp@48460000 { compatible = "ti,dra7-mcasp-audio"; ti,hwmods = "mcasp1"; reg = <0x48460000 0x2000 0x45800000 0x1000>; reg-names = "mpu", "dat"; interrupts = <0x0 0x68 0x4 0x0 0x67 0x4>; interrupt-names = "tx", "rx"; dmas = <0xf7 0x81 0x1 0xf7 0x80 0x1>; dma-names = "tx", "rx"; clocks = <0xf8 0xf9 0xfa>; clock-names = "fck", "ahclkx", "ahclkr"; #status = "disabled"; gpio-controller; #gpio-cells = <2>; #gpio = <0x1a5 0x7 0x0>; status = "okay"; phandle = <0x1fd>; };

MUX_dat.h:

{MCASP1_AXR5, (M14 | PIN_OUTPUT_PULLUP)}, /* mcasp1_axr5.gpio5_7 */ 

What else will be required need to be configured to use this pin in general purpose mode.

Although am able to use this pin by using sysfs.

Regards,

Geek13

  • Hello Geek13,

    MCASP1_AXR5 (F13) is already pinmuxed as GPIO5_7 in <Processor SKD>/board-support/u-boot-<version>/board/ti/am57xx/mux_data.h file under core_padconf_array_essential_x15.

        {MCASP1_AXR5, (M14 | PIN_INPUT_PULLDOWN)},    /* mcasp1_axr5.gpio5_7 */

    Geek13 said:
    What else will be required need to be configured to use this pin in general purpose mode.

    Nothing else. You can now export it as gpio 135 and use it.

    echo 135 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio135/direction
    echo 0 > /sys/class/gpio/gpio135/value
    echo 1 > /sys/class/gpio/gpio135/value

    Best regards,
    Kemal

  • Hi Kemal,

      But why I need to use sysfs to use that gpio. As am using this GPIO from DSP core. 

      Using sysfs its ok, am able to access this gpio. But my main requirement is to use this gpio5_7 from DSP.

      Also tried with padconfig for this pin in DSP side as below:  

    HW_WR_REG32(
    SOC_CORE_PAD_IO_REGISTERS_BASE + CSL_CONTROL_CORE_PAD_IO_PAD_MCASP1_AXR5, 0x0000000E );

    But that also not works. I didn't found how to enable clock for MCASP1 in DSP.

    Or what else is required to use this GPIO??

    Regards,

    Geek13

  • Hello,

    To configure the GPIO from the DSP side, you need to disable the corresponding GPIO instance in the Linux device tree and perform the pinmuxing/configuration in the DSP code. 

    Please refer to the standalone DSP project GPIO_LedBlink for an example of configuring the GPIO on the DSP side.

    Regards,
    Sahin

  • Thanks Sahin.

    Regards,

    Geek13