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.

Power off the PMIC from AM1808 Linux

Other Parts Discussed in Thread: AM1808, TPS650250, DA8XX

HI

     We are developing custom device based on AM1808 processor and PMIC IC is TPS650250 i need to power off the  processor and PMIC when i am shut down the OS. 

How to perform this action?

When i was working in AM335x we connect the PMIC power enable pin to the RTC ALARM interrupt pin then we shutdown the PMIC when alarm interrupt occur. Here is there any pin assigned for RTC interrupt?

Help me to perform this task. 

  • Hi,

    You can try to power down the PMIC through GPIO,

    We have RTC_ALARM pin for deep sleep power management (wakeup),

    Refer the PINMUX0 register for configuring the RTC_ALARM pin.

  • Hi

         Just now i checked the RTC_ALARM pin this pin is GP0[8]/DEEPSLEEP/RTC_ALARM.

    In my case i should need to use F4 ball as OUTPUT then only i can drive the PMIC. As per AM1808 TRM (chapter 9.9) we can use F4 ball as output in two method, one is RTC_ALARM and another one is GP0[8]. 

    1. In RTC_ALRAM mode if we Configure the DEEPSLEEP/RTC_ALARM pin to output RTC_ALARM. The pin is driven low since the alarm has not yet occurred. So we can't use it to drive my PMIC because after kernel boot F4 is low by default. But device enters the Deep Sleep mode since the DEEPSLEEP pin is low after as per SLEEPCOUNT. 

    2. As per chapter "9.9.4 Entering/Exiting Deep Sleep Mode Using Software Handshaking" this one is will work for me.

    9.9.4.1 Entering Deep Sleep Mode
    The following example sequence can be used to activate the Deep Sleep mode using a handshaking
    mechanism between your device and an external device:
    1. Clear the SLEEPENABLE bit in the deep sleep register (DEEPSLEEP) in the System Configuration
    (SYSCFG) Module chapter to 0. The DEEPSLEEP pin has no effect until software running on the
    device sets this bit.
    2. Configure the GP0[8]/DEEPSLEEP/RTC_ALARM pin to output GP0[8] using the PINMUX0_31_28 bits
    in the PINMUX0 register in the System Configuration (SYSCFG) Module chapter. When the pin is
    configured for GPIO functionality, the internal DEEPSLEEP signal is still driven by the value on the pin.
    3. Configure the GP0[8] pin to generate interrupts on the falling edge of the GPIO signal.
    4. An external device drives the GP0[8] pin low.
    5. Software prepares the device for Deep Sleep mode.
    6. Set the SLEEPENABLE bit in DEEPSLEEP to 1. The Deep Sleep mode is immediately started and all
    device clocks are stopped. Also, the SLEEPCOMPLETE bit is automatically cleared.

    here 1 and 2 step is fine and i can't get the 3 point and rest of the steps could you please clear me ?

    at pt3 how to generate interrupt on the falling edge of the signal ?
    at pt4 AM1808 drive the GP0 low or external controller will drive GP0 to low because GP0 is configured as OP
    Or we can use RTC_ALARM mode?
    Thanks
    Sangly
  • Hi,

    When you require DEEPSLEEP (DS),

    1) Need to configure the GP0[8] as input, so that the external device(ucontroller :MSP430) able to drive to initiate DS or wakeup from DS.

    There are 2 ways to wakeup/initiate from DS

    i.GP0[8] (external controller shd drive to wakeup from DS)

    ii.RTC (it will drive low to wakeup automatically with RTC values)

    So, You have to select accordingly & also your app dependent.

    2) Follow the chapter 9.9

    You can configure the GPIO as falling edge or rising edge interrupt in linux

        gpio_to_irq(GPIO0_8)

        status = request_irq(irq_num, gpio_interrupt,0,"gpio_int", NULL);

        irq_set_irq_type(irq_num,IRQ_TYPE_EDGE_FALLING);

    As per the above code snippet, It will call the ISR ("gpio_interrupt" fn)when you get the falling edge signal on GP0[8]

    If you intended to disable/power down only the PMIC, then there is chance PMIC through any GPIO pin after "init 0" executes.

  • Hi

          I guess you misunderstood  my problem. Let me explain once again.

    My PMIC have PWR_EN pin if i drive this pin high PMIC will be shutdown. Here i want to shutdown the PMIC from AM1808 processor. So whats the proper procedure to drive the RTC_ALARM pin high/low when deepsleep mode entered ?

    For a proper shutdown first i need to shutdown the filesystem by "shutdown -h now". Here is my idea,

    1. I will issue the "shutdown -h now" command programmatic (is there any other way to shutdown file system?) 

    2. At the same time i'll set the DEEPSLEEP's COUNT as we desired, (COUNT== Time taken to shutdown the FS)

    3. If the DEEPSLEEP/RTC_ALARM/GP0[8] is configured as OP then i will get OP signal from this pin if ALARM occured

    4. Then i'll drive the PMIC from this signal 

    Is't correct and it will work fine? But the problem is in which mode F4 ball drive the OP if ALARM occurred ?

    And how to write the DA8XX_DEEPSLEEP_REG dynamically in board file if user event occurred ?

    Thanks

    Sangly 

  • Hi,

    Do you want to shutdwon the PMIC after poweroff or DEEPSLEEP implementation?

  • Hi

            Just i want to shutdown my PMIC and my device. And i need to shutdown after poweroff. 

  • Hi,

    I have a experienced this case,

    I have a power supply board (PSU) that power the ARM processor,

    The system wont switch off when i give "poweroff or "shutdown -h now"even after housing processes.

    Then i configured one GPIO for power control purpose and ll drive high to PSU to shutdown the ARM.

    For that, I will issue "gpio_set_value(GPIO_POWER_CONTROL,1)" to drive high for PSU to shutdown the system completely.

    I modified the file which will run after housing processes.

    linux-source/kernel/sys.c

    What do you say?

  • Hi

    This is exactly what i am expecting. I modified the files kernel/sys.c and arch/arm/kernel/process.c and drive the PMIC PWR_EN successfully

    Thanks

    Sangly 

  • Hi,

    Thanks, Such a fast update,

    Im glad that you fixed,

    Can you please close this thread,