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.

Using the RTC with the am335x (PG2.1 silicon) and tps65217B PMIC

Other Parts Discussed in Thread: TPS65217

Hi,

I have a custome AM335x design based on the BeagleBone.  I want to keep the RTC on the AM335x (PG2.1 silicon) working when the unit it shutdown.  So I looked at the TPS65217B datasheet and decided that the PMIC needs to be in "SLEEP" mode, not "OFF" mode, so that we maintain RTC power out of LDO1 of the PMIC.  I modified the Linux kernel (ti-sdk-05.07.00.00), drivers/mfd/tps65217.c:tps65217_probe() accordingly.  [Don't set 'OFF' bit in 'STATUS' register, as we want to go to tps65217 'SLEEP' mode (Vrtc on), not 'OFF' mode (all supplies off).]

This works, when I use the "poweroff" Linux command the unit powers down and LDO1/RTC power is maintained.  The problem is now wakeup.

It would appear that I need to enable EXT_WAKEUP in the am335x RTC_PMIC register (rtc_base + OMAP_RTC_PMIC_REG).  This would allow the tps65217 wakeup signal to wakeup the am335x (and thus driver the PMIC_PWR_EN).  

Does this seem right?  No-one seems to have done this when I google it.  What bits in RTC_PMIC should be set:  there are 4 wake up bits, which corresponds to the EXT_WAKEUP pin on the AM335x?

  • Ok, ext_wakeup0 works from "RTC only" mode (TRM section 8.1.4.3.6) if we enable it in the RTC_PMIC register of the AM335x, as follows.

    johnmu@johnmu-VirtualBox:~/ti-sdk-am335x-evm-05.07.00.00/board-support/linux-3.2.0-psp04.06.00.10$ diff -up drivers/rtc/rtc-omap.c.orig drivers/rtc/rtc-omap.c
    --- drivers/rtc/rtc-omap.c.orig 2013-05-24 10:40:28.277166699 +1200
    +++ drivers/rtc/rtc-omap.c 2013-05-24 10:43:19.475013432 +1200
    @@ -318,7 +318,10 @@ static void rtc_power_off(void)

    /* Set PMIC power enable */
    val = readl(rtc_base + OMAP_RTC_PMIC_REG);
    - writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
    +// JFM: was
    +// writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
    +// JFM: acitve low nWAKEUP from PMIC (assume bit0=wakeup0=ext_wakeup), enable wakup.
    + writel(val | OMAP_RTC_PMIC_POWER_EN_EN | 0x11, rtc_base + OMAP_RTC_PMIC_REG);

    /* Wait few seconds instead of rollover */
    do {
    johnmu@johnmu-VirtualBox:~/ti-sdk-am335x-evm-05.07.00.00/board-support/linux-3.2.0-psp04.06.00.10$