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.

AM625: Unexpected GPIO behavior when resuming from the Deep Sleep mode.

Part Number: AM625

Tool/software:

Good morning Support Team,

We are running the latest TI SDK SW 9.2.8--v09.02.08 on custom hardware.

We have observed unusual behavior with some GPIO pins on the AM62x. So far, we have identified this issue with two specific pins: GPMC0_CLK (P25) and USB0_DRVVBUS (C20), although other pins might also be affected.

If the GPIO pin level is set to High before entering Deep Sleep mode, it drops to zero for approximately 200ms just before resuming from Deep Sleep mode, as shown in the attached image.

We use these GPIOs to control the power of some peripheral devices and want to avoid any situations where the peripherals are unexpectedly power cycled.

This issue was mentioned once by the TI team in this topic https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1361669/am625-gpio-output-state-in-deep-sleep

Also, it was mentioned that TI is working on finding a solution for that.

Is there any progress there? Is it possible to fix this issue?

Thank you.

  • Hello,

    I don't think we have a solution for this item yet. I'll check internally.

    Just to make sure, do these pins have an external resistor attached?

    We've noticed in previous tests that pulling the internet, active state resistor high has helped on GPIOs that don't have an external resistor. This was done by setting the PADCONFIG Bit 16=0 & Bit 17=1. Try this change and let us know the results.


    Best Regards,
    Anshu

  • Hi 

    Both pins GPMC0_CLK (P25) and USB0_DRVVBUS (C20) has an external 100k pull-down resistors and they can't be changed to pull-ups.

    I turned on the internal pull up for the GPMC0_CLK (P25) pin by setting the PADCONFIG Bits as you suggested.

    I still have a signal dropping to zero volts before resuming from Deep Sleep mode. But now it drops to zero for 500ns instead of 200ms.

    But we should not have any voltage drops on this pin before exiting from the DeepSleep mode.

  • Hello,

    Thank you for the update. Let me share these results internally and from there can try some ideas to debug this further.

    Best Regards,

    Anshu

  • Hello,

    Can you try the following patch for the GPIO driver? The idea is to check the GPIO is restoring its value before the IO Isolation step.

    diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
    index 69f3d864f69d..fc25e3d5fc77 100644
    --- a/drivers/gpio/gpio-davinci.c
    +++ b/drivers/gpio/gpio-davinci.c
    @@ -698,8 +698,13 @@ static int davinci_gpio_resume(struct device *dev)
            return 0;
     }
      
    -DEFINE_SIMPLE_DEV_PM_OPS(davinci_gpio_dev_pm_ops, davinci_gpio_suspend,
    -                        davinci_gpio_resume);
    +//DEFINE_SIMPLE_DEV_PM_OPS(davinci_gpio_dev_pm_ops, davinci_gpio_suspend,
    +//                      davinci_gpio_resume);
    +
    +static const struct dev_pm_ops davinci_gpio_dev_pm_ops = {
    +        .suspend = davinci_gpio_suspend,
    +        .resume_noirq = davinci_gpio_resume,
    +};
      
     static const struct of_device_id davinci_gpio_ids[] = {
            { .compatible = "ti,keystone-gpio", keystone_gpio_get_irq_chip},

    Best Regards,

    Anshu

  • Hello,

    Apologies for the confusion. Ignore the GPIO patch in the previous post. Please try the attached patch on ti_sci.c

    drivers/firmware/ti_sci.c | 38 ++++++++++++++++++++++++++++++++++++++
     1 file changed, 38 insertions(+)
    
    diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
    index 7323f44bab7e..072cbe6d6aa2 100644
    --- a/drivers/firmware/ti_sci.c
    +++ b/drivers/firmware/ti_sci.c
    @@ -3735,11 +3735,33 @@ static int ti_sci_suspend(struct device *dev)
     	return 0;
     }
     
    +
    +static	u32 gpio_dir[8], gpio_out[8];
    +
     static int ti_sci_suspend_noirq(struct device *dev)
     {
     	struct ti_sci_info *info = dev_get_drvdata(dev);
     	int ret = 0;
     
    +	void __iomem *gpio_chip_1, *gpio_chip_2; // We are saving gpio context...
    +	gpio_chip_1 = ioremap(0x00600000, 0x100);
    +	gpio_chip_2 = ioremap(0x00601000, 0x100);
    +	for (int i = 0; i < 8; i++)
    +	{
    +		if(i<4) {
    +			gpio_dir[i] = readl(gpio_chip_1 + 0x10 + i*0x28); // DIR 01 start
    +			gpio_out[i] = readl(gpio_chip_1 + 0x14 + i*0x28);  // OUT_DATA01 start next starts after 0x28
    +		}
    +		else {
    +			gpio_dir[i] = readl(gpio_chip_2 + 0x10 + (i-4)*0x28); // DIR 01 start
    +			gpio_out[i] = readl(gpio_chip_2 + 0x14 + (i-4)*0x28);  // OUT_DATA01 start next starts after 0x28
    +
    +		}
    +	}
    +	
    +	dev_info(dev, "%s: Saving gpio ctx dir = |%x| out = |%x|\n", __func__, 
    +			 gpio_dir[0], gpio_out[0]);
    +
     	ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_ENABLE);
     	if (ret)
     		return ret;
    @@ -3754,6 +3776,22 @@ static int ti_sci_resume(struct device *dev)
     	u32 source;
     	u64 time;
     	int ret = 0;
    +	void __iomem *gpio_chip_1, *gpio_chip_2; // We are restoring gpio context...
    +	gpio_chip_1 = ioremap(0x00600000, 0x100);
    +	gpio_chip_2 = ioremap(0x00601000, 0x100);
    +	for (int i = 0; i < 8; i++)
    +	{
    +		if (i < 4) {
    +			writel(gpio_dir[i],gpio_chip_1 + 0x10 + i*0x28); // DIR 01 start
    +			writel(gpio_out[i], gpio_chip_1 + 0x14 + i*0x28);  // OUT_DATA01 start next starts after 0x28
    +		} else {
    +			writel(gpio_dir[i],gpio_chip_2 + 0x10 + (i-4)*0x28); // DIR 01 start
    +			writel(gpio_out[i], gpio_chip_2 + 0x14 + (i-4)*0x28);  // OUT_DATA01 start next starts after 0x28
    +		}
    +	}
    +	
    +	dev_info(dev, "%s: restoring gpio ctx dir = |%x| out = |%x|\n", __func__, 
    +			 gpio_dir[0], gpio_out[0]);
     
     	ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_DISABLE);
     	if (ret)
    
    base-commit: 6de6e418c80edfbe08f4a5f851c721bd60c0123b
    -- 
    2.34.1
    

    Best Regards,

    Anshu