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.

[TDA4-j7-EVM] Using gpio in linux userspace

Part Number: PROCESSOR-SDK-DRA8X-TDA4X


Hello,

I've tried to use one pin from the EVM to be used as gpio output from userspace (i.e. sysfs or gpio-hammer). I tried to set the pin as PIN_OUTPUT_PULLUP and GPIO in the 'TI Pinmux Tool'. I got the code for the .dtsi out of the pinmux tool and applied it to the k3-j7*-common-proc*.dts file, following the advice in [e2e.ti.com/.../862697]

I managed to boot and run linux, but I didn't observe what I expect from the userspace gpio tools.

When I write and read-back (either through sysfs or gpio-hammer), I see that the value didn't change.

After playing a bit with the gpiocontroller and going throught the TRM, I understood that the macro J721E_IOPAD does not configure the gpio controller in the appropriate way.

I found out that if bit 18 of the controller is not, I was not able to readback from the gpio.

When he macro is updated as follows:

(k3.h):

-#define PIN_OUTPUT             (INPUT_DISABLE | PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP      (INPUT_DISABLE | PULL_UP)
-#define PIN_OUTPUT_PULLDOWN    (INPUT_DISABLE | PULL_DOWN)
+#define PIN_OUTPUT             (INPUT_EN | PULL_DISABLE)
+#define PIN_OUTPUT_PULLUP      (INPUT_EN | PULL_UP)
+#define PIN_OUTPUT_PULLDOWN    (INPUT_EN | PULL_DOWN)
 

I'm able to write/readback succesfully. However this does not make much sense from electrical point of view.

Could anyone advise, on what is the correct way to set the GPIOs for the J7-EVM?