Hello,
I am designing custom board with a AM3359 and a TPS65217 PMIC compatible with Beaglebone White.
I would like to shutdown the system by GPIO button from u-boot loader (before Linux loading).
I implemented solution with PWR_EN signal under control from ALARM2 event in the RTC
(as described in e2e.ti.com/.../348819
and minix-i2c.blogspot.ru/.../software-power-off-of-am335x-with.html )
I tested modified u-boot loader on my custom board and on Beaglebone White.
It is work.
But I have long delay from GPIO button pressing to powering off board (switching off green LED D1).
I investigated this problem with oscilloscope.
(please see attached screenshot).
Channel 1 - GPIO button,
channel 2 - PWR_EN pin of TPS65217 (PMIC_POWR_EN signal on schematic of Beaglebone White, rev.A6A),
channel 3 - PWR_LEDR signal,
channel 4 - SYS_5V signal.
As I understand, I have 1 second delay at least due to ALARM2 solution
(because I write into ALARM2_SECONDS_REG content of SECONDS_REG + 1 sec)
But I don't understand why PMIC is powered off after 2.52 sec delay.
My algorithm:
if (GPIO_button_pressed) {
set_OFF_bit_in_TPS65217_STATUS_register();
set_SEQDWN_bit_in_TPS65217_SEQ6_register();
writel(ALARM_WAKEEN, OMAP_RTC_IRQWAKEEN);
writel(PWR_ENABLE_EN, OMAP_RTC_RTC_PMIC);
writel(IT_ALARM2, OMAP_RTC_INTERRUPTS_REG);
writel(readl(OMAP_RTC_SECONDS_REG) + 1, OMAP_RTC_ALARM2_SECONDS_REG); /* 1 sec delay */
writel(1, OMAP_RTC_CTRL_REG); /* start RTC */
waiting_powering_off();
}
My questions are:
1. What is reason of the PMIC delay (deltaT=2.52s on screenshot)?
(What is happen inside PMIC from pull down PWR_EN signal to powering off?)
2. How I can reduce this delay (ideally to switch off immediately)?
3. Does exist another solution to power off board instead ALARM2 event?
Best regards,
Oleg.