AnsweredAssumed Answered

GPIO set and clear time duration in u-boot in IMX6

Question asked by udaya kumar on Jul 5, 2017
Latest reply on Jul 5, 2017 by igorpadykov

Hello,

   We are using IMX6Quad processor where we set and clear a gpio 3,21 with assembly code in u-boot given below

 

static iomux_v3_cfg_t const gpio_toggle_pads[] = {
    MX6_PAD_EIM_D21__GPIO3_IO21    | MUX_PAD_CTRL(NO_PAD_CTRL),
};

 

static void gpio_toggle(void)
{
    imx_iomux_v3_setup_multiple_pads(gpio_toggle_pads, ARRAY_SIZE(gpio_toggle_pads));
    gpio_direction_output(IMX_GPIO_NR(3, 21),0);

    asm(" ldr r0,=0x20A4000");
    asm(" ldr r1,=(1<<21)");
    asm(" ldr r2,=(0<<21)");

    asm(" str r1,[r0]");
    asm(" str r2,[r0]");

    asm(" str r1,[r0]");
    asm(" str r2,[r0]");

    asm(" str r1,[r0]");

}

where for the first low to high is 300ns , and others either low to high or high to low its around 270ns.

1.why this much delay(270ns) between setting and clearing of gpio in imx6 processors ?

2.please provide us solutions to reduce it if possible ?

 

thanks,

uday

Outcomes