Other Parts Discussed in Thread: TPS65910, TPS65217, TPS65218, TPS650250
Tool/software: Linux
Hi
We are working on latest TI SDK ti-am335x-03.02.00.05 and using a custom am335x hardware.
We have a use case in which when the board enters RTC only mode,it should undergo full boot after the time specified by rtcwake command.
We have migrated from the Old SDK 7 to the latest one. In SDK 7 we are having a working RTC-only mode where the current drops upto 10mA when we give rtcwake -d /dev/rtc0 -m standby -s 5.
At this moment the PMIC_POWER_EN bit becomes zero and current drops upto 10mA.
But this is not happening in our latest SDK.
We need the same thing working in the new SDK.
We have done the following changes:
1)This is our configuration in the dtsi file:
&rtc {
clocks = <&clk_32768_ck>, <&clkdiv32k_ick>;
clock-names = "ext-clk", "int-clk";
system-power-controller;
};
&tps {
/*
* Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
* mode") at poweroff. Most BeagleBone versions do not support RTC-only
* mode and risk hardware damage if this mode is entered.
*
* For details, see linux-omap mailing list May 2015 thread
* [PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
* In particular, messages:
* www.spinics.net/.../msg118585.html
* www.spinics.net/.../msg118615.html
*
* You can override this later with
* &tps { /delete-property/ ti,pmic-shutdown-controller; }
* if you want to use RTC-only mode and made sure you are not affected
* by the hardware problems. (Tip: double-check by performing a current
* measurement after shutdown: it should be less than 1 mA.)
*/
/* ti,pmic-shutdown-controller;*/ /*Commenting ti,pmic-shutdown-controller */
2) In RTC OMAP Driver:
We have added omap_rtc_power_off() inside omap_rtc_suspend . But still this is not working.
static int omap_rtc_suspend(struct device *dev)
{
struct omap_rtc *rtc = dev_get_drvdata(dev);
printk(KERN_INFO "***omap_rtc_suspend***\n");
rtc->interrupts_reg = rtc_read(rtc, OMAP_RTC_INTERRUPTS_REG);
rtc->type->unlock(rtc);
/*
* FIXME: the RTC alarm is not currently acting as a wakeup event
* source on some platforms, and in fact this enable() call is just
* saving a flag that's never used...
*/
if (device_may_wakeup(dev))
enable_irq_wake(rtc->irq_alarm);
else
rtc_write(rtc, OMAP_RTC_INTERRUPTS_REG, 0);
rtc->type->lock(rtc);
rtc->is_suspending = true;
omap_rtc_power_off(); /*Added to power off */
return 0;
We are getting the following logs:
root@ngt:~# rtcwake -d /dev/rtc0 -m standby -s 5
[ 43.813401] ***omap_rtc_alarm_irq_enable***
wakeup from "standby" at Sat Jan 1 00:00:49 2000
[ 43.979218] PM: Syncing filesystems ... done.
[ 43.986685] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 43.995229] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 44.004306] Suspending console(s) (use no_console_suspend to debug)
[ 44.119603] ***omap_rtc_suspend***
[ 44.119618] ***omap_rtc_power_off***
[ 44.119631] ***omap_rtc_power_off_program***
[ 44.119642] ****The value of OMAP_RTC_PMIC_REG is ****10011
[ 44.119647] System will go to power_off state in approx. 1 second
[ 47.114778] rtc_power_off failed, bailing out.
[ 47.115155] PM: suspend of devices complete after 3102.994 msecs
[ 47.117446] PM: late suspend of devices complete after 2.264 msecs
[ 47.119423] ***omap_rtc_runtime_suspend***
[ 47.119997] PM: noirq suspend of devices complete after 2.528 msecs
[ 47.120003] PM: Successfully put all powerdomains to target state
[ 47.122669] PM: noirq resume of devices complete after 2.555 msecs
[ 47.122801] ***rtc_irq***
[ 47.122862] ***omap_rtc_alarm_irq_enable***
[ 47.124866] PM: early resume of devices complete after 1.950 msecs
[ 47.125447] ***omap_rtc_resume***
[ 47.295700] PM: resume of devices complete after 170.804 msecs
[ 47.381898] Restarting tasks ... done.
[ 47.400425] ***omap_rtc_alarm_irq_enable
Can anyone please give some suggestion