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 turned on from u-boot to kernel

Other Parts Discussed in Thread: AM3874, SYSCONFIG

Hi everybody, 

Set an gpio as output with "1" on the u-boot and it should keep this value during the kernel startup. But the driver "/linux/arch/arm/plat-omap/gpio.c"  always  reset this value to zero and i have to reinitialize it on the kernel. I could not found where this value is being overwritten.

PS: I'm using AM3874

Thank you

  • Hi Guilherme,

    The official guidelines for configuring the GPIO is:

    from kernel space:
    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide#Kernel_Level

    from user space:
    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide#User_Space_-_Sysfs_control

    I think your u-boot value is overwritten from the kernel _set_gpio_direction() and _set_gpio_dataout() functions from the gpio.c file. If you still need to stuck at the u-boot GPIO configuration, you can try to modify/comment these two functions.

    Best regards,
    Pavel

  • I solve my problem removing  this flag(SYSC_HAS_SOFTRESET) from GPIO  ssysconfig

    index 871bdb8..af71345 100644

    @@ -500,7 +500,7 @@ static struct omap_hwmod_class_sysconfig ti81xx_gpio_sysc = {
    .sysc_offs = 0x0010,
    .syss_offs = 0x0114,
    .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
    - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
    + SYSC_HAS_SIDLEMODE /*| SYSC_HAS_SOFTRESET*/ |
    SYSS_HAS_RESET_STATUS),
    .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
    SIDLE_SMART_WKUP),