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.

Retain GPIO pin state from u-boot to Kernel

Hi All,

I'm working on am335x based custom designed board.

I have requirement to retain the GPIO pin state while booting kernel which is set in u-boot.

Currently i'm able to drive an GPIO3_19(115) to output high in u-boot. This GPIO pin enable battery power supply, which drives the further booting process of board if i disconnect main power supply cable.

The problem i'm facing here is, When the u-boot loads kernel and handover the execution control to kernel, as soon as kernel starts booting which will reset the GPIO state i.e it will pull down. so the board stops booting because battery power supply disconnects.

My requirement is once the GPIO 115 pin set as output high in u-boot it shouldn't alter at any cost while booting kernel.

Is there any way i can achieve this ? please suggest me if need to do any changes in u-boot or kernel

Regards,

Thiru N

  • Hi,

    You should check that the GPIO module is not reinitialized in the kernel and that the GPIO pin pinmux value is not altered from its u-boot value.
  • Hi Biser,

    Thanks for your response,

    Is it possible to control from device tree(dtb) ? if so please suggest me how i can do it.

    (or) Need to change device driver, if so i need to protect entire bank from initialization, which is not correct because i'm not initializing all 32 pins of GPIO bank in u-boot.

    Please suggest me best way to tackle it.

  • Hi,

    No need to change the driver. This only dts settings. Let's say that you use gpio3_19 on ball C13 (pin name is MCASP0_FSR, see Table 4-1. Ball Characteristics (ZCE and ZCZ Packages) in device data manual). So you need to set:
    0x1A4 (PIN_INPUT_PULLUP | MUX_MODE7) //sets MCASP0_FSR to GPIO3_19 with input enable & pull up.
    in gpio3 pinmux node.

    Best Regards,
    Yordan