0

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.....
}

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

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},
}

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?

  • Well, the first thing I would do when debugging this is add some printfs to confirm that the functions in question are being called when I expect them to. – Tom Rini Jul 24 '16 at 15:58
  • cannot add prints because at this time no console or uart is configured. – pointer accurate Jul 24 '16 at 16:11
  • That doesn't sound right. Why are you doing this so extremely early, given that UART is something that is configured really early on. It would also help to debug this if you provide a unified diff of your changes along with a reference to what version of U-Boot you're working with. – Tom Rini Jul 24 '16 at 16:48
  • u-boot-2016.07 this is the version of u-boot I am using. Yes I can do it after serial initialisation but it should work when actual muxing happens. There is no big difference from actual file. I am giving a link so you can see which file. – pointer accurate Jul 24 '16 at 17:28
  • OK, so this looks to be around the right place to make changes. The next thing to try is, do you see and measure what you expect if you use the gpio command to toggle things at the U-Boot prompt? – Tom Rini Jul 24 '16 at 17:42

0 Answers0