Setting GPIO in spl does not work

I want to know how to pin multiplex pins in initial phase of boot i.e is in spl(MLO). What I am trying to do is change the default pin configuration to gpio one, so that I can see high or low on the pin.

On P8 header I tried to change the mode 0 from default ‘TIMER4’ to gpio2[2] i.e mode 7. So I did this

static struct module_pin_mux gpio2_2_pin_mux[] = {
    {OFFSET(gpmc_wen), (MODE(7) | PULLUDEN)},   
    {-1},
};

and called this function

configure_module_pin_mux(gpio2_2_pin_mux);

in board/ti/am335x/mux.c

I didn’t saw any voltage on 7th pin of P8 header?

What is the correct way to do this?

file link : http://textuploader.com/5eh6u you can search with ‘?’ in the file to see what I added.

P.S I checked with checking pin mux setting on uart0 and tried to read it if that is same.

So I wrote this in ./arch/arm/cpu/armv7/omap-common/boot-common.c

void spl_board_init(void)
{
     /*
     * Save the boot parameters passed from romcode.
     * We cannot delay the saving further than this,
     * to prevent overwrites.
     */
    save_omap_boot_params();
    unsigned int *mfi;
        //control revision register

    /* Prepare console output */
        mfi = *(unsigned int *)(0x44E10980);
        printf("1======> %x\n",mfi);
    preloader_console_init();//it will print uboot version date and time information
    mfi = *(unsigned int *)(0x44E10980);
            printf("2======> %x\n",mfi);

more init code.....
}


If I read it right, you are trying to set pin gpio2_2 to mode 7 by calling “configure_module_pin_mux” in function “enable_uart0_pin_mux”, neither gpio2_2 pin nor uart0 pins are in the states you expected.
It seems to indicate “enable_uart0_pin_mux” may not be called during the initialization.
If it is possible, could you place a printf in “enable_uart0_pin_mux” to see if it is actually called. That may give you some hints on what is going on.

Hope this help.