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.

can't write to GPIO control registers with u-boot

Other Parts Discussed in Thread: SYSCONFIG

Running a board with a Davinci 814x chip. Trying to access GPIO pins from u-boot. I put the following in the second stage of u-boot.

    printf("about to write 0x00000004 into 0x%x\n", base + OMAP4_GPIO_SYSCONFIG);
    __raw_writel(0x4, base + OMAP4_GPIO_SYSCONFIG);

output is

about to write 0x00000004 into 0x48032010

then hang. (no register dump). similar behavior for just about anything in any GPIO register. I'm calling this right after the mux set_muxconf_regs(); call. The GPIOs work fine once Linux booted. I can't figure out what Linux is doing to get access to the GPIO control registers.

thanks,

Chris

  • Hi Chris,

    AFAIK gpio clock is not enabled by the movement you do __raw_writel(0x4, base + OMAP4_GPIO_SYSCONFIG); and you are seeing the hang

    First enable the gpio0 clock and the then try writing to the GPIO registers

    These lines needs to be added

    __raw_writel(0x2, CM_ALWON_GPIO_0_CLKCTRL);

    while(__raw_readl(CM_ALWON_GPIO_0_CLKCTRL) != 0x2);

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!