iMX8 share DTS informations with the co-processor

cancel
Showing results for 
Search instead for 
Did you mean: 

iMX8 share DTS informations with the co-processor

63 Views
Cupcake
Contributor I

Hi,

 

For our application we have a Yocto OS on iMX8 that runs some high level applications then we also have a more critical application that runs in the co-processor (cortex-m7).

 

Currently we have:

  • Linux: a DTS file, that define pinmuxing and driver/interface configuration
  • Cortex-m7: pin_mux.c file generated by MCUExpresso Config Tools.

 

We would like to integrate the content of pin_mux.c in our main .dts (based on the example generated by MCUExpresso Config Tools).

 

But the question is:

  • Did you know any ways to declare the GPIO's/Peripheral in the DTS, and access it at runtime using a label from the cortex-m7 ? 

 

For example in our cortex-m7 code, we would like to replace this:

GPIO_PinWrite(GPIO3, 23U, 1U);

 

By something like this:

GPIO_PinWrite(gpio_port_dts_value("S2LP_CS"), gpio_pin_dts_value("S2LP_CS"), 1U);

 

Like this, our code in cortex-m7 will be based on DTS/DTB informations and we should have only one file (the DTS) to adapt our applications to the target board.

 

I know that nordic made this kind of stuffs in Zephyr, that's why I had this idea. 

0 Kudos
0 Replies