I am trying to set gpio immidiatly after power cycle.
I want to do it in u-boot enviormant before kernel loads.
found two possible solutions:
1. use gpio-hog in device tree. so few example how to use in device trees of other boards.
2. setting it in board_init function under board/freescale/imx8mn_evk/imx8mn_evk.c by adding gpio_request gpio_direction_output.
I am using yocto imx-5.15.5-1.0.0 honister and cannot find much information how to do this.
I belive both approaches cannot work together. one will overwrite the other.
which one I should use ?
BR,
Roy
BR,
Roy
Hi @razriel,
I hope you are doing well.
To set the GPIO during startup in U-Boot one could add a script to set the IO.
E.g.,
# setenv set-io 'gpio set <gpio-number>'
# setenv bootcmd 'run set-io; run ubiboot; run sdboot'
# saveenv
Or else you can use the board_init function to access the GPIO.
Either one can be used.
Thank you.
Best Regards,
Dhruvit.
Hi @razriel,
You can define a script in the environment variable, as described in my last reply for the automatic access of the GPIO.
And for the board_init function method can also be part of the image creation.
Best Regards,
Dhruvit.