Setting GPIO in MLO does not work
<p>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.</p>

<p>On P8 header I tried to change the mode 0 from default 'TIMER4' to gpio2[2] i.e mode 7. So I did this</p>

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

<p>and called this function</p>

<pre><code>configure_module_pin_mux(gpio2_2_pin_mux);
</code></pre>

<p>in board/ti/am335x/mux.c</p>

<p>I didn't saw any voltage on 7th pin of P8 header?</p>

<p>What is the correct way to do this?</p>

<p>file link : <a href="http://textuploader.com/5eh6u" rel="nofollow">http://textuploader.com/5eh6u</a>
you can search with '?' in the file to see what I added.</p>

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

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

<pre><code>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======&gt; %x\n",mfi);
    preloader_console_init();//it will print uboot version date and time information
    mfi = *(unsigned int *)(0x44E10980);
            printf("2======&gt; %x\n",mfi);

more init code.....
}
</code></pre>

<p>I wanted to see this setting done in board/ti/am335x/mux.c</p>

<pre><code>static struct module_pin_mux uart0_pin_mux[] = {
    {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},  /* UART0_RXD */
    {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},      /* UART0_TXD */
    {-1},
}
</code></pre>

<p>But it printed value as 37. that means the pin is in GPIO mode.
How is this possible that the pin that should be in mode 0 is in 7th mode?</p>