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.

GPIO - startup signals - where to put them?

Hi I have a general linux question. We have our own board design, similar to beaglebone black. We have a couple of on-board devices which need GPIOs set to a value or a simple Lo / High 2 sec / Lo sequence. Where is the best place to do this?

I can put the code to do this in the \board\ti\am335x\board.c files and it works. However, subsequent initialisation (possibly the DTS stuff) resets the GPIOs.

I can set the GPIO type in a DTS file successfully (i.e. make it an output or input with pullup) but not set it's value, much less sequence it.

I have scripts which work which could be run from init.d but one of the signals starts a USB Hub and I would like this already booted when other USB udev rules run, hence the desire to get this set up earlier.

I get that devices have modules which can be loaded by mod_probe automatically - but to do this I'd need to create a kernel module to just set a gpio. Is this a world of pain I can avoid? Or is it quite simple really? Will setting up gpios in the board.c file always get over-written?