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.

AM3352: RTC-only wakeup unstable

Part Number: AM3352
Other Parts Discussed in Thread: TPS65910,

Hello,

I'm working to implement AM335X RTC-Only mode on our custom boards with AM3352 CPU and TPS65910 PMIC and the device fails to raise PMIC_POWER_EN after rtc-wakeup.
I'm using TI-Linux (ti2014.10.00 == 3.14.19) with patched-in support for our board.

After initiating RTC-Only powerdown according to TI wiki (processors.wiki.ti.com/.../Linux_Core_Power_Management_User's_Guide_(v3.14)
- exception: using rtc1 as wakeup source because I have to use the pmic-rtc - the power consumption drops for the requested number of seconds via rtcwake.
Then the power consumption rises again and I can observe a cold boot on the debug console as it starts up U-Boot.
But this lasts only for about 1 second, then the device is switched off again with power consumption dropping to powerdown levels.

I determined that the PMIC is responsible for this powerdown.
In the datasheet (www.ti.com/lit/ds/symlink/tps65910.pdf) it states in chapter 5.22.2 Power Control Timing:
---
NOTE: (1) The DEV_ON control bit (set to 1) or the PWRHOLD signal (set high) can be used to maintain supplies on after
switch-on sequence, If none of these devices POWER-ON enable condition are set the supplies will be turned off
after TdOINT1 delay.
---
TdOINT1 is specified to be 1 second on table 5-5.

DEV_ON is 0 and PWRHOLD is low after wakeup.

This leaves two options:
(1) Set DEV_ON = 1 in PMIC to force power supply on.
    This works and allows full cold boot, but having DEV_ON = 1 prohibits power off for following RTC-Only cycles.
    Also as soon as DEV_ON is cleared to 0 even after TdOINT1 the device shuts off immediately.
(2) Set PMIC input PWRHOLD to high. This input is connected to AM3352's output pin PMIC_POWER_EN.

Right now I'm stuck on option (2) as option (1) is not usable as mentioned.
I tried clearing bit PWR_ENABLE_EN in register RTC_PMIC and clearing ALARM2 interrupt status to no avail.
I took register dumps of PMIC-RTC and AM3352-RTC on a regular boot and after rtc-wakeup.

Please let me know if further information is needed.
Thanks for any ideas.

Best regards,
Michael Krummsdorf

After_RTC_Wakeup.txt
After 10 seconds RTC Wakeup via PMIC RTC.
Linux command: 
echo 1 > /sys/kernel/debug/pm_debug/enable_off_mode;
echo enabled > /sys/class/rtc/rtc1/device/power/wakeup;
rtcwake -d /dev/rtc1 -m mem -s 10

PMIC TPS65910 @ I2C address 0x2d
U-Boot# i2c md 0x2d 0x0.1 0x80
0000: 33 02 00 01 01 00 00 00 00 01 00 01 01 00 00 00    3...............
0010: 01 c2 08 00 00 27 00 00 00 00 00 00 9f 0d 09 00    .....'..........
0020: 01 0d 2b 00 05 2b 00 04 00 00 00 00 00 00 00 00    ..+..+..........
0030: 09 0d 01 0d 0d 0d 09 01 0d 00 00 00 00 00 3b 14    ..............;.
0040: 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    5...............
0050: 40 bf 00 03 00 00 00 00 00 00 00 00 00 00 00 00    @...............
0060: 0a 0a 0a 0a 0a 0a 00 00 00 00 00 00 00 00 00 00    ................
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

AM3352 RTCSS Registers
U-Boot# md.l 0x44e3e000 0x40
44e3e000: 00000042 00000002 00000000 00000001    B...............
44e3e010: 00000001 00000000 00000000 00000000    ................
44e3e020: 00000020 00000000 00000000 00000001     ...............
44e3e030: 00000001 00000002 00000000 00000000    ................
44e3e040: 00000001 00000082 00000010 00000000    ................
44e3e050: 00000040 00000048 00000000 00000000    @...H...........
44e3e060: 80991f0c 33548cd0 00000800 00000800    ......T3........
44e3e070: 00000800 4eb01106 00000003 00000000    .......N........
44e3e080: 00000050 00000000 00000000 00000001    P...............
44e3e090: 00000001 00000000 00030004 00000000    ................
44e3e0a0: 00000000 00000000 00000000 00000000    ................
44e3e0b0: 00000000 00000000 00000000 00000000    ................
44e3e0c0: 00000000 00000000 00000000 00000000    ................
44e3e0d0: 00000000 00000000 00000000 00000000    ................
44e3e0e0: 00000000 00000000 00000000 00000000    ................
44e3e0f0: 00000000 00000000 00000000 00000000    ................
U-Boot# mw.l 0x44e3e098 0	# Clear RTC_PMIC.PWR_ENABLE_EN
U-Boot# md.l 0x44e3e098 1
44e3e098: 00020000		# Pin PMIC_POWER_EN still low
U-Boot# mw.l 0x44e3e044 0x80	# Clear ALARM2 interrupt status
U-Boot# md.l 0x44e3e044 1
44e3e044: 00000002		# Pin PMIC_POWER_EN still low
U-Boot# i2c mw 0x2d 0x3f.1 0x10	# Release PMIC Bit DEV_ON
-> Device shuts down
Regular_power_up.txt
Regular power up:

PMIC TPS65910 @ I2C address 0x2d
U-Boot# i2c md 0x2d 0x0.1 0x80
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 9f 0d 09 00    ................
0020: 01 0d 00 00 05 00 00 04 00 00 00 00 00 00 00 00    ................
0030: 09 0d 01 0d 0d 0d 09 01 0d 00 00 00 00 00 3b 60    ..............;`
0040: 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    5...............
0050: 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060: 0a 0a 0a 0a 0a 0a 00 00 00 00 00 00 00 00 00 00    ................
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

AM3352 RTCSS Registers
U-Boot# mw 0x44e3e064 0x33548cd0 # Writing BOARD-Type + MAGIC to SCRATCH1 for linux am33xx pm driver.
U-Boot# md.l 0x44e3e000 0x40
44e3e000: 00000000 00000000 00000000 00000001    ................
44e3e010: 00000001 00000000 00000000 00000000    ................
44e3e020: 00000020 00000000 00000000 00000001     ...............
44e3e030: 00000001 00000002 00000000 00000000    ................
44e3e040: 00000000 00000000 00000002 00000000    ................
44e3e050: 00000040 00000048 00000000 00000000    @...H...........
44e3e060: 00200002 33548cd0 00000800 00000800    .. ...T3........
44e3e070: 00000800 4eb01106 00000002 00000000    .......N........
44e3e080: 00000000 00000000 00000010 00000001    ................
44e3e090: 00000001 00000000 00000004 00000000    ................
44e3e0a0: 00000000 00000000 00000000 00000000    ................
44e3e0b0: 00000000 00000000 00000000 00000000    ................
44e3e0c0: 00000000 00000000 00000000 00000000    ................
44e3e0d0: 00000000 00000000 00000000 00000000    ................
44e3e0e0: 00000000 00000000 00000000 00000000    ................
44e3e0f0: 00000000 00000000 00000000 00000000    ................