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 control from within u-boot

Other Parts Discussed in Thread: AM1808, DA8XX

Hi all,

I'm working on AM1808 EVM from LogicPD

From within

board/davinci/da8xxevm/da850evm.c

I can toggle GP2[6] high or low using the existing code, but I cannot do the same for GP2[12]. Why ?

After having done the following, the pin 25 of J30 still remain to logic level 1 !

int mycode(void)

{

                const struct pinmux_config gpio_pins[] = {

                               { pinmux(5), 8, 3 },

                };

 

                u32 val;

 

                /* PinMux for GPIO */

                if (davinci_configure_pin_mux(gpio_pins, ARRAY_SIZE(gpio_pins)) != 0)

                               return 1;

 

                /* Set the GPIO direction as output */

                clrbits_be32((u32 *)GPIO_BANK2_REG_DIR_ADDR, (0x01 << 12));

 

                /* Set the output as low */

                val = readl(GPIO_BANK2_REG_CLR_ADDR);

                val |= (0x01 << 12);

                writel(val, GPIO_BANK2_REG_CLR_ADDR);

 

                return 0;

}

Thanks,

Gabriele

  • Gabriele,

    Do you have anything connected to J30?

    If there is nothing else driving that pin, then please make sure you are setting the pinmux register correctly (PINMUX5_15_12=8). -- Does   { pinmux(5), 8, 3 }, achieve that?

    regards,

    Paul

  • Dear Paul,

    for some reason I missed to read your reply, and I apologies for this incident.
    Since the day I've posted my question I've done some progress and now I've gained
    control over GPIO as desired by exploiting the da8xx GPIO support provided by u-boot 2011.12-rc1.
    I'm referring to the use of
    gpio_request()
    gpio_direction_input()
    gpio_direction_output()
    gpio_set_value()
    ..
    This has been accomplished by enabling
    #define CONFIG_DA8XX_GPIO
    within the config file.

    Thank you so much and have a happy new year,
    Gabriele