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.

Initialization of Gpio on Omap in Kernel

Hi;

I've done some research, and yes there is a great deal in info here on accessing gpio in user space.

However, I am looking to initialize the gpio levels (so that the pins are at a know state) when the kernel boots (so in kernel space).  I can't relay on the application running, once the kernel is up, to set the pin levels.

So heres what I've done so far:

I set the mux pins like this (as an example)

    omap_mux_init_signal("mcbsp1_dx", OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT);   

And then I set the level like this.

   gpio_set_value(MOTOR_ENABLE_PIN, 1);

Now when I scope the pin I see the pin change state to a High, but later on as the kernel continues to boot the pin gets reconfigured (I guess).  And yes you can guess what happens, the motor turns on when it really should be quiet until command otherwise in user space.

Without kernel debugging, where is the best place in the kernel code to ensure that the state of the pins are what I intend?

I am using the TIDM3730.

Thanks in advance.

MikeM

  • You can try placing your custom initialization at the bottom of the board init() function in your board.c file. That should override the earlier kernel earlier initialization.

    If you have Linux configuring the pinmux, you should be able to configure the pin as part of the kernel init. I am not familiar with this platform. Not sure where the actual table is. Search for CONFIG_DAVINCI_MUX or CONFIG_OMAP_MUX. Look for some source that compiled to a ".o". There should be table of type mux_config in there.