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.

AM572x GPIO Reset in Kernel

Other Parts Discussed in Thread: AM5728

Hi,

We have a custom HW design based on AM5728 and PSDK V2.0.0.0
The devices connected to AM5728 peripherals on the board are being controlled by the processor GPIOs. At U-Boot, the pin mux works fine
and we are able to access the peripheral devices as expected. However at Kernel, the GPIOs are getting Reset and we are
looking for a way to avoid the same. That is, we need the output GPIOs to retain their state being set at U-Boot and these GPIOs must
get registered to the kernel framework (access possible through sysfs entry)

Please note the following regarding this issue:
1. The pinmux is done only at MLO.
2. In Kernel device tree file, we are initializing the GPIO banks and registering these to GPIO framework.

What we have tried so far?
1. Modified the GPIO driver (drivers/gpio/gpio-omap.c, after the GPIO banks are initialized) to re-write the GPIO DATAOUT registers with the same value as set in U-Boot.
This has not worked for us.
2. Once kernel comes up, directly accessing these GPIO registers using devmem2/sysfs and modifying the values fail and we see kernel
warnings and it does not work.

Please help us!

Regards,
Shareef

  • I will forward this to the software team. They will respond here.
  • Hi Shareef,

    You're correct that for AM57xx, most of the pinmux is done in u-boot. However, there is still the possibility to add GPIO pinmuxes in dts file as well, so that it will keep the pinmux settings you require.

    Best Regards,
    Yordan
  • Hi Yordan,

    Yes, I am aware of adding GPIO pinmux in dts file. My questions are as follows:

    1. I want to retain the GPIO state in Kernel which was set in U-Boot without affecting state of the GPIOs during kernel bring up. Is this possible? Could you tell us how?
    2. We noticed that the GPIO controller gets reset when Kernel comes up, let us know as to how this can avoid affecting my GPIOs being set in U-Boot.
    3. We would require the GPIOs to get registered to the Kernel GPIO framework so that the GPIOs are accessible from kernel.

    Look forward to your response for each of the above points.

    Regards,
    Shareef
  • Hi Shareef,

    1. I want to retain the GPIO state in Kernel which was set in U-Boot without affecting state of the GPIOs during kernel bring up. Is this possible? Could you tell us how?
    2. We noticed that the GPIO controller gets reset when Kernel comes up, let us know as to how this can avoid affecting my GPIOs being set in U-Boot

    I have the following suggestions:
    1. Verify that there are no other modules in your system that use the same device pads as the gpio.
    2. Add:
    status = "okay";
    and
    ti,gpio-always-on;
    in the corresponding gpio nodes in dra7.dtsi

    3. We would require the GPIOs to get registered to the Kernel GPIO framework so that the GPIOs are accessible from kernel.

    This should already be possible using the /sys/class/gpio framework.

    Best Regards,
    Yordan