All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ran Wang <ran.wang_1@nxp.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	kuldip dwivedi <kuldip.dwivedi@puresoftware.com>,
	Leo Li <leoyang.li@nxp.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Biwen Li <biwen.li@nxp.com>, Varun Sethi <V.Sethi@nxp.com>,
	Arokia Samy <arokia.samy@nxp.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	Paul Yang <Paul.Yang@arm.com>,
	tanveer <tanveer.alam@puresoftware.com>
Subject: RE: [PATCH v1] soc: fsl: rcpm: Add ACPI support
Date: Wed, 16 Sep 2020 01:32:29 +0000	[thread overview]
Message-ID: <AM6PR04MB5413903EAAEDB2EED2E254C6F1210@AM6PR04MB5413.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <4e008f0a-69da-d5c2-4dfc-ef8695e17f47@arm.com>

Hi Ard,

On Tuesday, September 15, 2020 7:10 PM, Ard Biesheuvel wrote:
> Subject: Re: [PATCH v1] soc: fsl: rcpm: Add ACPI support
> 
> On 9/15/20 1:06 PM, kuldip dwivedi wrote:
> > Add ACPI support in fsl RCPM driver. This is required to support ACPI
> > S3 state. S3 is the ACPI sleep state that is known as "sleep" or
> > "suspend to RAM".
> > It essentially turns off most power of the system but keeps memory
> > powered.
> >
> > Signed-off-by: tanveer <tanveer.alam@puresoftware.com>
> > Signed-off-by: kuldip dwivedi <kuldip.dwivedi@puresoftware.com>
> 
> Why does the OS need to program this device? Can't this be done by
> firmware?

This device is use to tell HW which IP (such as USB, SDHC, SATA, etc) should not be
clock gated during system enter low power state (to allow that IP work as a
wakeup source). And user does this configuration in device tree. So implement
this RCPM driver to do it in kernel rather than firmware.

Regards,
Ran

> > ---
> >
> > Notes:
> >      1. Add ACPI match table
> >      2. NXP team members are added for confirming HID changes
> >      3. There is only one node in ACPI so no need to check for
> >         current device explicitly
> >      4. These changes are tested on LX2160A and LS1046A platforms
> >
> >   drivers/soc/fsl/rcpm.c | 22 +++++++++++++++++++---
> >   1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c index
> > a093dbe6d2cb..e75a436fb159 100644
> > --- a/drivers/soc/fsl/rcpm.c
> > +++ b/drivers/soc/fsl/rcpm.c
> > @@ -2,10 +2,12 @@
> >   //
> >   // rcpm.c - Freescale QorIQ RCPM driver
> >   //
> > -// Copyright 2019 NXP
> > +// Copyright 2019-2020 NXP
> > +// Copyright 2020 Puresoftware Ltd.
> >   //
> >   // Author: Ran Wang <ran.wang_1@nxp.com>
> >
> > +#include <linux/acpi.h>
> >   #include <linux/init.h>
> >   #include <linux/module.h>
> >   #include <linux/platform_device.h>
> > @@ -57,8 +59,13 @@ static int rcpm_pm_prepare(struct device *dev)
> >   				rcpm->wakeup_cells + 1);
> >
> >   		/*  Wakeup source should refer to current rcpm device */
> > -		if (ret || (np->phandle != value[0]))
> > -			continue;
> > +		if (is_acpi_node(dev->fwnode)) {
> > +			if (ret)
> > +				continue;
> > +		} else {
> > +			if (ret || (np->phandle != value[0]))
> > +				continue;
> > +		}
> >
> >   		/* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the
> >   		 * number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup"
> > @@ -139,10 +146,19 @@ static const struct of_device_id rcpm_of_match[]
> = {
> >   };
> >   MODULE_DEVICE_TABLE(of, rcpm_of_match);
> >
> > +#ifdef CONFIG_ACPI
> > +static const struct acpi_device_id rcpm_acpi_match[] = {
> > +	{ "NXP0015", },
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(acpi, rcpm_acpi_match); #endif
> > +
> >   static struct platform_driver rcpm_driver = {
> >   	.driver = {
> >   		.name = "rcpm",
> >   		.of_match_table = rcpm_of_match,
> > +		.acpi_match_table = ACPI_PTR(rcpm_acpi_match),
> >   		.pm	= &rcpm_pm_ops,
> >   	},
> >   	.probe = rcpm_probe,
> >


WARNING: multiple messages have this Message-ID (diff)
From: Ran Wang <ran.wang_1@nxp.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	kuldip dwivedi <kuldip.dwivedi@puresoftware.com>,
	Leo Li <leoyang.li@nxp.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Biwen Li <biwen.li@nxp.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	Arokia Samy <arokia.samy@nxp.com>, Paul Yang <Paul.Yang@arm.com>,
	Varun Sethi <V.Sethi@nxp.com>,
	tanveer <tanveer.alam@puresoftware.com>
Subject: RE: [PATCH v1] soc: fsl: rcpm: Add ACPI support
Date: Wed, 16 Sep 2020 01:32:29 +0000	[thread overview]
Message-ID: <AM6PR04MB5413903EAAEDB2EED2E254C6F1210@AM6PR04MB5413.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <4e008f0a-69da-d5c2-4dfc-ef8695e17f47@arm.com>

Hi Ard,

On Tuesday, September 15, 2020 7:10 PM, Ard Biesheuvel wrote:
> Subject: Re: [PATCH v1] soc: fsl: rcpm: Add ACPI support
> 
> On 9/15/20 1:06 PM, kuldip dwivedi wrote:
> > Add ACPI support in fsl RCPM driver. This is required to support ACPI
> > S3 state. S3 is the ACPI sleep state that is known as "sleep" or
> > "suspend to RAM".
> > It essentially turns off most power of the system but keeps memory
> > powered.
> >
> > Signed-off-by: tanveer <tanveer.alam@puresoftware.com>
> > Signed-off-by: kuldip dwivedi <kuldip.dwivedi@puresoftware.com>
> 
> Why does the OS need to program this device? Can't this be done by
> firmware?

This device is use to tell HW which IP (such as USB, SDHC, SATA, etc) should not be
clock gated during system enter low power state (to allow that IP work as a
wakeup source). And user does this configuration in device tree. So implement
this RCPM driver to do it in kernel rather than firmware.

Regards,
Ran

> > ---
> >
> > Notes:
> >      1. Add ACPI match table
> >      2. NXP team members are added for confirming HID changes
> >      3. There is only one node in ACPI so no need to check for
> >         current device explicitly
> >      4. These changes are tested on LX2160A and LS1046A platforms
> >
> >   drivers/soc/fsl/rcpm.c | 22 +++++++++++++++++++---
> >   1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c index
> > a093dbe6d2cb..e75a436fb159 100644
> > --- a/drivers/soc/fsl/rcpm.c
> > +++ b/drivers/soc/fsl/rcpm.c
> > @@ -2,10 +2,12 @@
> >   //
> >   // rcpm.c - Freescale QorIQ RCPM driver
> >   //
> > -// Copyright 2019 NXP
> > +// Copyright 2019-2020 NXP
> > +// Copyright 2020 Puresoftware Ltd.
> >   //
> >   // Author: Ran Wang <ran.wang_1@nxp.com>
> >
> > +#include <linux/acpi.h>
> >   #include <linux/init.h>
> >   #include <linux/module.h>
> >   #include <linux/platform_device.h>
> > @@ -57,8 +59,13 @@ static int rcpm_pm_prepare(struct device *dev)
> >   				rcpm->wakeup_cells + 1);
> >
> >   		/*  Wakeup source should refer to current rcpm device */
> > -		if (ret || (np->phandle != value[0]))
> > -			continue;
> > +		if (is_acpi_node(dev->fwnode)) {
> > +			if (ret)
> > +				continue;
> > +		} else {
> > +			if (ret || (np->phandle != value[0]))
> > +				continue;
> > +		}
> >
> >   		/* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the
> >   		 * number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup"
> > @@ -139,10 +146,19 @@ static const struct of_device_id rcpm_of_match[]
> = {
> >   };
> >   MODULE_DEVICE_TABLE(of, rcpm_of_match);
> >
> > +#ifdef CONFIG_ACPI
> > +static const struct acpi_device_id rcpm_acpi_match[] = {
> > +	{ "NXP0015", },
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(acpi, rcpm_acpi_match); #endif
> > +
> >   static struct platform_driver rcpm_driver = {
> >   	.driver = {
> >   		.name = "rcpm",
> >   		.of_match_table = rcpm_of_match,
> > +		.acpi_match_table = ACPI_PTR(rcpm_acpi_match),
> >   		.pm	= &rcpm_pm_ops,
> >   	},
> >   	.probe = rcpm_probe,
> >


WARNING: multiple messages have this Message-ID (diff)
From: Ran Wang <ran.wang_1@nxp.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	kuldip dwivedi <kuldip.dwivedi@puresoftware.com>,
	Leo Li <leoyang.li@nxp.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Biwen Li <biwen.li@nxp.com>,
	Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	Arokia Samy <arokia.samy@nxp.com>, Paul Yang <Paul.Yang@arm.com>,
	Varun Sethi <V.Sethi@nxp.com>,
	tanveer <tanveer.alam@puresoftware.com>
Subject: RE: [PATCH v1] soc: fsl: rcpm: Add ACPI support
Date: Wed, 16 Sep 2020 01:32:29 +0000	[thread overview]
Message-ID: <AM6PR04MB5413903EAAEDB2EED2E254C6F1210@AM6PR04MB5413.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <4e008f0a-69da-d5c2-4dfc-ef8695e17f47@arm.com>

Hi Ard,

On Tuesday, September 15, 2020 7:10 PM, Ard Biesheuvel wrote:
> Subject: Re: [PATCH v1] soc: fsl: rcpm: Add ACPI support
> 
> On 9/15/20 1:06 PM, kuldip dwivedi wrote:
> > Add ACPI support in fsl RCPM driver. This is required to support ACPI
> > S3 state. S3 is the ACPI sleep state that is known as "sleep" or
> > "suspend to RAM".
> > It essentially turns off most power of the system but keeps memory
> > powered.
> >
> > Signed-off-by: tanveer <tanveer.alam@puresoftware.com>
> > Signed-off-by: kuldip dwivedi <kuldip.dwivedi@puresoftware.com>
> 
> Why does the OS need to program this device? Can't this be done by
> firmware?

This device is use to tell HW which IP (such as USB, SDHC, SATA, etc) should not be
clock gated during system enter low power state (to allow that IP work as a
wakeup source). And user does this configuration in device tree. So implement
this RCPM driver to do it in kernel rather than firmware.

Regards,
Ran

> > ---
> >
> > Notes:
> >      1. Add ACPI match table
> >      2. NXP team members are added for confirming HID changes
> >      3. There is only one node in ACPI so no need to check for
> >         current device explicitly
> >      4. These changes are tested on LX2160A and LS1046A platforms
> >
> >   drivers/soc/fsl/rcpm.c | 22 +++++++++++++++++++---
> >   1 file changed, 19 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c index
> > a093dbe6d2cb..e75a436fb159 100644
> > --- a/drivers/soc/fsl/rcpm.c
> > +++ b/drivers/soc/fsl/rcpm.c
> > @@ -2,10 +2,12 @@
> >   //
> >   // rcpm.c - Freescale QorIQ RCPM driver
> >   //
> > -// Copyright 2019 NXP
> > +// Copyright 2019-2020 NXP
> > +// Copyright 2020 Puresoftware Ltd.
> >   //
> >   // Author: Ran Wang <ran.wang_1@nxp.com>
> >
> > +#include <linux/acpi.h>
> >   #include <linux/init.h>
> >   #include <linux/module.h>
> >   #include <linux/platform_device.h>
> > @@ -57,8 +59,13 @@ static int rcpm_pm_prepare(struct device *dev)
> >   				rcpm->wakeup_cells + 1);
> >
> >   		/*  Wakeup source should refer to current rcpm device */
> > -		if (ret || (np->phandle != value[0]))
> > -			continue;
> > +		if (is_acpi_node(dev->fwnode)) {
> > +			if (ret)
> > +				continue;
> > +		} else {
> > +			if (ret || (np->phandle != value[0]))
> > +				continue;
> > +		}
> >
> >   		/* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the
> >   		 * number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup"
> > @@ -139,10 +146,19 @@ static const struct of_device_id rcpm_of_match[]
> = {
> >   };
> >   MODULE_DEVICE_TABLE(of, rcpm_of_match);
> >
> > +#ifdef CONFIG_ACPI
> > +static const struct acpi_device_id rcpm_acpi_match[] = {
> > +	{ "NXP0015", },
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(acpi, rcpm_acpi_match); #endif
> > +
> >   static struct platform_driver rcpm_driver = {
> >   	.driver = {
> >   		.name = "rcpm",
> >   		.of_match_table = rcpm_of_match,
> > +		.acpi_match_table = ACPI_PTR(rcpm_acpi_match),
> >   		.pm	= &rcpm_pm_ops,
> >   	},
> >   	.probe = rcpm_probe,
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-16  1:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 11:06 [PATCH v1] soc: fsl: rcpm: Add ACPI support kuldip dwivedi
2020-09-15 11:06 ` kuldip dwivedi
2020-09-15 11:06 ` kuldip dwivedi
2020-09-15 11:10 ` Ard Biesheuvel
2020-09-15 11:10   ` Ard Biesheuvel
2020-09-15 11:10   ` Ard Biesheuvel
2020-09-16  1:32   ` Ran Wang [this message]
2020-09-16  1:32     ` Ran Wang
2020-09-16  1:32     ` Ran Wang
2020-09-16  6:10     ` Ard Biesheuvel
2020-09-16  6:10       ` Ard Biesheuvel
2020-09-16  6:10       ` Ard Biesheuvel
2020-09-16  6:40       ` Ran Wang
2020-09-16  6:40         ` Ran Wang
2020-09-16  6:40         ` Ran Wang
2020-09-22 23:13       ` Li Yang
2020-09-22 23:13         ` Li Yang
2020-09-22 23:13         ` Li Yang
2020-09-16  1:21 ` Ran Wang
2020-09-16  1:21   ` Ran Wang
2020-09-16  1:21   ` Ran Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR04MB5413903EAAEDB2EED2E254C6F1210@AM6PR04MB5413.eurprd04.prod.outlook.com \
    --to=ran.wang_1@nxp.com \
    --cc=Paul.Yang@arm.com \
    --cc=Samer.El-Haj-Mahmoud@arm.com \
    --cc=V.Sethi@nxp.com \
    --cc=ard.biesheuvel@arm.com \
    --cc=arokia.samy@nxp.com \
    --cc=biwen.li@nxp.com \
    --cc=kuldip.dwivedi@puresoftware.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tanveer.alam@puresoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.