All of lore.kernel.org
 help / color / mirror / Atom feed
* proper power off implementation for iMX6 with external pmic
@ 2017-03-30 11:02 ` Oleksij Rempel
  0 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2017-03-30 11:02 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam, linux-arm-kernel, Sascha Hauer,
	Sebastian Reichel, linux-pm

Hallo all,

i'm looking for proper way to implement pm_power_off for IMX6 with 
external PMIC.

http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
page 5083

According to this documentation, there are two ways to power off, 
depending on board configuration. With internal and external PMIC.

Internal variant is implemented in:
drivers/power/reset/imx-snvs-poweroff.c

and should provide support for fallowing sequence:

Configuration with internal PMIC:
1.  SoC button is pressed for a short duration.
2.  Interrupt request (irq) is sent to SoC from FSM
3.  Alarm timer is set up by software routine and started.
4.  Upon alarm_in assertion to '1', PMIC_ON_REQ goes '0'.
5.  External regulator goes OFF.

Suddenly i can't find any existing code for external PMIC.

Configuration with external PMIC:
1.  Button is pressed for a short duration on the external PMIC.
2.  Interrupt request (irq) is sent to SoC from external PMIC
3.  SoC is programming PMIC for power off when standby is asserted.
4.  In CCM STOP mode, Standby is asserted, PMIC gates SoC supplies.

partially needed  code is implemented here:
  arch/arm/mach-imx/pm-imx6.c
...
         case STOP_POWER_OFF:
                 val |= 0x2 << BP_CLPCR_LPM;
                 val |= 0x3 << BP_CLPCR_STBY_COUNT;
                 val |= BM_CLPCR_VSTBY;
                 val |= BM_CLPCR_SBYOS;
....
but used only for PM_SUSPEND_MEM and never for pm_power_off.

do i miss some thing, or are there any patches floating around?
If it is not implemented jet and no one is working on this i would do it.
I assume it should be configurable over device tree. Correct?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* proper power off implementation for iMX6 with external pmic
@ 2017-03-30 11:02 ` Oleksij Rempel
  0 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2017-03-30 11:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hallo all,

i'm looking for proper way to implement pm_power_off for IMX6 with 
external PMIC.

http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
page 5083

According to this documentation, there are two ways to power off, 
depending on board configuration. With internal and external PMIC.

Internal variant is implemented in:
drivers/power/reset/imx-snvs-poweroff.c

and should provide support for fallowing sequence:

Configuration with internal PMIC:
1.  SoC button is pressed for a short duration.
2.  Interrupt request (irq) is sent to SoC from FSM
3.  Alarm timer is set up by software routine and started.
4.  Upon alarm_in assertion to '1', PMIC_ON_REQ goes '0'.
5.  External regulator goes OFF.

Suddenly i can't find any existing code for external PMIC.

Configuration with external PMIC:
1.  Button is pressed for a short duration on the external PMIC.
2.  Interrupt request (irq) is sent to SoC from external PMIC
3.  SoC is programming PMIC for power off when standby is asserted.
4.  In CCM STOP mode, Standby is asserted, PMIC gates SoC supplies.

partially needed  code is implemented here:
  arch/arm/mach-imx/pm-imx6.c
...
         case STOP_POWER_OFF:
                 val |= 0x2 << BP_CLPCR_LPM;
                 val |= 0x3 << BP_CLPCR_STBY_COUNT;
                 val |= BM_CLPCR_VSTBY;
                 val |= BM_CLPCR_SBYOS;
....
but used only for PM_SUSPEND_MEM and never for pm_power_off.

do i miss some thing, or are there any patches floating around?
If it is not implemented jet and no one is working on this i would do it.
I assume it should be configurable over device tree. Correct?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper power off implementation for iMX6 with external pmic
  2017-03-30 11:02 ` Oleksij Rempel
@ 2017-04-02  7:15   ` Guy Shapiro
  -1 siblings, 0 replies; 4+ messages in thread
From: Guy Shapiro @ 2017-04-02  7:15 UTC (permalink / raw)
  To: Oleksij Rempel, Shawn Guo, Fabio Estevam, linux-arm-kernel,
	Sascha Hauer, Sebastian Reichel, linux-pm

On 30/03/2017 14:02, Oleksij Rempel wrote:

> Hallo all,
>
> i'm looking for proper way to implement pm_power_off for IMX6 with external PMIC.
>
> http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
> page 5083
>
> According to this documentation, there are two ways to power off, depending on board configuration. With internal and external PMIC.
>
> Internal variant is implemented in:
> drivers/power/reset/imx-snvs-poweroff.c
>
Currently all the mainline DT definitions use the syscon-poweroff driver
and not imx-snvs-poweroff.  The syscon-poweroff binding includes the
bits to set on the "snvs_lp control register". One of those bits is
"Dumb PMIC Enable" (DP_EN) that looks related to the external PMIC mode.

I never tried to use the external PMIC mode myself. If I had to, I would
start by clearing this bit.

Guy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* proper power off implementation for iMX6 with external pmic
@ 2017-04-02  7:15   ` Guy Shapiro
  0 siblings, 0 replies; 4+ messages in thread
From: Guy Shapiro @ 2017-04-02  7:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 30/03/2017 14:02, Oleksij Rempel wrote:

> Hallo all,
>
> i'm looking for proper way to implement pm_power_off for IMX6 with external PMIC.
>
> http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
> page 5083
>
> According to this documentation, there are two ways to power off, depending on board configuration. With internal and external PMIC.
>
> Internal variant is implemented in:
> drivers/power/reset/imx-snvs-poweroff.c
>
Currently all the mainline DT definitions use the syscon-poweroff driver
and not imx-snvs-poweroff.  The syscon-poweroff binding includes the
bits to set on the "snvs_lp control register". One of those bits is
"Dumb PMIC Enable" (DP_EN) that looks related to the external PMIC mode.

I never tried to use the external PMIC mode myself. If I had to, I would
start by clearing this bit.

Guy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-02  7:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 11:02 proper power off implementation for iMX6 with external pmic Oleksij Rempel
2017-03-30 11:02 ` Oleksij Rempel
2017-04-02  7:15 ` Guy Shapiro
2017-04-02  7:15   ` Guy Shapiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.