Device tree configurations for heterogenous processing

Hi,
We were using Colibri iMX6 for our products, but now due to some data acquisition problems, we switched to iMX7 so that we can use M4 for data acquisition and A7 for our processing. As we have switched the module,
I have some doubts regarding the pin configurations in device tree.If we are going to use a gpio pin from M4, Toradex advices to enable a whole gpio bank for M4.

1.If we are going to use GPIO bank 4 from M4, then how to disable the whole gpio bank 4 in device tree?

I could see gpio4-grp under iomux in device tree. But I could see some pins from different gpio banks under this gpio4-grp.So will disabling this disable the gpio bank 4?

2.If we have GPIO bank 4 completely disabled from Linux using device tree, then is it possible to access the other peripherals that are muxed with GPIO bank 4 from Linux? For example,let’s say I have completely disabled the GPIO bank 4 for using them in M4, but I need to use the ECSPI3 from the Linux side. The ECSPI3 pins are muxed with gpio bank 4 pins. Is it possible?

Hi @nishanth1829

Thanks for writing to the Toradex Community!

1.If we are going to use GPIO bank 4 from M4, then how to disable the whole gpio bank 4 in device tree?

You just need to make sure that no pin from gpio bank 4 is used/muxed as GPIO in Linux or in U-Boot.

If we have GPIO bank 4 completely disabled from Linux using device tree, then is it possible to access the other peripherals that are muxed with GPIO bank 4 from Linux? For example,let’s say I have completely disabled the GPIO bank 4 for using them in M4, but I need to use the ECSPI3 from the Linux side. The ECSPI3 pins are muxed with gpio bank 4 pins. Is it possible?

Yes, you are not allowed to mux the Pins as GPIO, but they can muxed to other functions as SPI or UART. This should work.

Best regards,
Jaski

Hi @jaski.tx ,
Thank you for your quick response. We are planning to disable the GPIO bank 4 and hence to use ECSPI3,ECSPI1,UART B,I2C3 with GPIOs from M4 side and UART A , UART C, usb.OTG2_PWR and usb.OTG2_OC from A7 side. So, for this , I need to remove all the GPIO4_IOXX pins from the device tree and then I need to configure the pins from the GPIO bank 4 for using them either as GPIO’s or as peripherals from M4. Is this approach correct?

Also, does disabling the GPIO bank 4 means removing all GPIO4_IOXX pins or do I need to change status of any node in device tree? What does the gpio4-grp under iomux in the device tree mean?

Thanks for your time,
Regards,
Nishanth

HI

Thank you for your quick response. We are planning to disable the GPIO bank 4 and hence to use ECSPI3,ECSPI1,UART B,I2C3 with GPIOs from M4 side and UART A , UART C, usb.OTG2_PWR and usb.OTG2_OC from A7 side. So, for this , I need to remove all the GPIO4_IOXX pins from the device tree and then I need to configure the pins from the GPIO bank 4 for using them either as GPIO’s or as peripherals from M4. Is this approach correct?

Yes, the approach is quite correct. The only thing is why you need gpio for I2C communication?

Also, does disabling the GPIO bank 4 means removing all GPIO4_IOXX pins or do I need to change status of any node in device tree?

Actually it means that the GPIO4 bank pins should not be declared as GPIOs. This can be done by disabling the nodes where this pins are used or by deleting the GPIO4_xxx PinMuxing.

What does the gpio4-grp under iomux in the device tree mean?

It is just a group, you can name it whatever you want.

Best regards,
Jaski

HI,

The only thing is why you need gpio for I2C communication?

We are not going to use gpio with i2c. We will be using gpio alongside with I2C and SPI. Sorry if that meant wrong.

Also, after disabling the gpio4 bank pins as gpios, is there way to find whether the pin are disabled correctly or not?

Regards,
Nishanth

Hi

Thanks for the clarification.

Also, after disabling the gpio4 bank pins as gpios, is there way to find whether the pin are disabled correctly or not?

Yes, there are two ways:

  1. check for gpios present in kernel cat /sys/kernel/debug/gpio
  2. or check for pins muxed as gpios cat /sys/kernel/debug/pinctrl/*/pinmux-pins | grep GPIO4

Best regards,
Jaski

Hi @jaski.tx
Thank you for the clarifications.
Regards,Nishanth

You are welcome.

Best regards,
Jaski