I want to write a little program for the M4 to toggle a GPIO with a specific (selectable) frequency. The manual points out that i should disable a whole GPIO bank in the device tree to give the M4 full access. Do i always need to do so or just when i want to use interrupt mode? Maybe there is a little demo which works out of the box for my setup? I am using a MX7D on a Viola board.
Thank you for this valuable information. Is the first gpio bank a good choice to put it away from the A7/Linux? Is there any good document which shows which pins of which bank are used for what?
Is there any good document which shows which pins of which bank are used for what?
Sorry but we don’t have any document with such information collated in a single place. You can find the pins configured as gpios by default as per the Colibri standard in Colibri iMX7 datasheet.
Ok. I already figured out that i want to use gpio bank 4 exclusivly for M4. IMHO the pins 11-15 on the Viola board connector X9 are all configured as gpios and belong to bank 4. So, where can i find mapping information like: gpio bank 1 == gpio@30200000… ?
I’m in the same situation. Actually this thread pointed me to this issue. So I hope it is okay to ask some additional questions.
While running Linux I can run the following command to see which GPIOs are in use:
cat /sys/kernel/debug/gpio
On my Viola board I get this output:
GPIOs 0-31, platform/30200000.gpio, 30200000.gpio:
gpio-0 (cd ) in lo
GPIOs 32-63, platform/30210000.gpio, 30210000.gpio:
GPIOs 64-95, platform/30220000.gpio, 30220000.gpio:
GPIOs 96-127, platform/30230000.gpio, 30230000.gpio:
gpio-103 (VCC_USB[1-4] ) out lo
GPIOs 128-159, platform/30240000.gpio, 30240000.gpio:
GPIOs 160-191, platform/30250000.gpio, 30250000.gpio:
GPIOs 192-223, platform/30260000.gpio, 30260000.gpio:
gpio-194 (? ) out lo
gpio-195 (Power-Key ) in hi
gpio-206 (id ) in lo
(I have added a gpio-poweroff(?) and a gpio-key(Power-Key).)
This means I can’t use any GPIO1_IOxx, GPIO4_IOxx and GPIO7_IOxx pins.
Is this correct?
This behavior becomes only an issue, when I want to use an GPIO as an interrupt source for the M4?
In my current configuration I could still use GPIO7_IO1 as an ‘regular’ input and/or output for the M4 without problems?
@qojote you are mention “…GPIO with a specific (selectable) frequency…”. You may able to use a PWM unit for such a task. Then you would have both cores for other tasks still available.
Any GPIO already used by a driver cannot be used on Linux unless you either disable the driver or change the pin multiplexing. For example, GPIO1_IO01 is used for wakeup from suspend and GPIO7_IO14 is used for USB client detect. It would be recommended that a GPIO bank used on the M4 side be not used on the Linux side or vice versa.