All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
@ 2011-04-28  6:38 Prabhakar Kushwaha
  2011-05-19  6:30 ` Kumar Gala
  0 siblings, 1 reply; 9+ messages in thread
From: Prabhakar Kushwaha @ 2011-04-28  6:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: meet2prabhu, Prabhakar Kushwaha, Jiang Yutang

D3-cold state indicates removal of the clock and power. however auxiliary (AUX)
Power may remain available even after the main power rails are powered down.

wakeup from D3-cold state requires full context restore. Other things are taken
care in pci-driver except ATMUs.
ATMU windows needs to be saved and restored during suspend and resume.

Signed-off-by: Jiang Yutang <b14898@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 Based upon git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(branch master)

 arch/powerpc/sysdev/fsl_pci.c |  116 +++++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.h |    7 ++-
 2 files changed, 121 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index f8f7f28..809fbfe 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -35,6 +35,9 @@
 #include <sysdev/fsl_pci.h>
 
 static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
+static int pcie_saved_pow_piw;
+struct pci_outbound_window_regs pcie_saved_pow[PCIE_POW_NUMBER];
+struct pci_inbound_window_regs pcie_saved_piw[PCIE_PIW_NUMBER];
 
 static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
 {
@@ -746,3 +749,116 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
 
 	return 0;
 }
+
+
+static int fsl_pcie_save_pow_piw(struct device_node *np,
+					struct resource *rsrc)
+{
+	struct ccsr_pci __iomem *pci;
+	int start_idx = 1, end_idx = 4;
+	unsigned int i;
+
+	pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
+
+	if (!pci) {
+		printk(KERN_WARNING"pcie_pow ioremap error!\n");
+		return -1;
+	}
+
+	if (of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
+		start_idx = 0;
+		end_idx = 3;
+	}
+
+	for (i = 0; i < PCIE_POW_NUMBER; i++) {
+		pcie_saved_pow[i].potar = in_be32(&pci->pow[i].potar);
+		pcie_saved_pow[i].potear = in_be32(&pci->pow[i].potear);
+		pcie_saved_pow[i].powbar = in_be32(&pci->pow[i].powbar);
+		pcie_saved_pow[i].powar = in_be32(&pci->pow[i].powar);
+	}
+
+	for (i = start_idx; i < end_idx; i++) {
+		pcie_saved_piw[i].pitar = in_be32(&pci->piw[i].pitar);
+		pcie_saved_piw[i].piwbar = in_be32(&pci->piw[i].piwbar);
+		pcie_saved_piw[i].piwbear = in_be32(&pci->piw[i].piwbear);
+		pcie_saved_piw[i].piwar = in_be32(&pci->piw[i].piwar);
+	}
+
+	iounmap(pci);
+	return 0;
+}
+
+static int fsl_pcie_restore_pow_piw(struct device_node *np,
+					struct resource *rsrc)
+{
+	struct ccsr_pci __iomem *pci;
+	int start_idx = 1, end_idx = 4;
+	unsigned int i;
+
+	pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
+
+	if (of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
+		start_idx = 0;
+		end_idx = 3;
+	}
+	if (!pci) {
+		printk(KERN_WARNING"pcie_pow ioremap error!\n");
+		return -1;
+	}
+
+	for (i = 0; i < PCIE_POW_NUMBER; i++) {
+		out_be32(&pci->pow[i].potar, pcie_saved_pow[i].potar);
+		out_be32(&pci->pow[i].potear, pcie_saved_pow[i].potear);
+		out_be32(&pci->pow[i].powbar, pcie_saved_pow[i].powbar);
+		out_be32(&pci->pow[i].powar, pcie_saved_pow[i].powar);
+	}
+
+	for (i = 0; i < PCIE_PIW_NUMBER; i++) {
+		out_be32(&pci->piw[i].pitar, pcie_saved_piw[i].pitar);
+		out_be32(&pci->piw[i].piwbar, pcie_saved_piw[i].piwbar);
+		out_be32(&pci->piw[i].piwbear, pcie_saved_piw[i].piwbear);
+		out_be32(&pci->piw[i].piwar, pcie_saved_piw[i].piwar);
+	}
+
+	iounmap(pci);
+	return 0;
+}
+
+static void fsl_pcie_suspend_save(struct pci_dev *dev)
+{
+	struct device_node *np;
+	struct resource rsrc;
+
+	if (pcie_saved_pow_piw == 1)
+		return;
+
+	for_each_node_by_type(np, "pci") {
+		if (of_device_is_compatible(np, "fsl,p1022-pcie")) {
+			of_address_to_resource(np, 0, &rsrc);
+			fsl_pcie_save_pow_piw(np, &rsrc);
+		}
+	}
+	pcie_saved_pow_piw = 1;
+}
+DECLARE_PCI_FIXUP_SUSPEND(0x1957, PCI_DEVICE_ID_P1022E, fsl_pcie_suspend_save);
+DECLARE_PCI_FIXUP_SUSPEND(0x1957, PCI_DEVICE_ID_P1022, fsl_pcie_suspend_save);
+
+static void fsl_pcie_resume_restore(struct pci_dev *dev)
+{
+	struct device_node *np;
+	struct resource rsrc;
+
+	if (pcie_saved_pow_piw == 0)
+		return;
+
+	for_each_node_by_type(np, "pci") {
+		if (of_device_is_compatible(np, "fsl,p1022-pcie")) {
+			of_address_to_resource(np, 0, &rsrc);
+			fsl_pcie_restore_pow_piw(np, &rsrc);
+		}
+	}
+	pcie_saved_pow_piw = 0;
+}
+DECLARE_PCI_FIXUP_RESUME(0x1957, PCI_DEVICE_ID_P1022E, fsl_pcie_resume_restore);
+DECLARE_PCI_FIXUP_RESUME(0x1957, PCI_DEVICE_ID_P1022, fsl_pcie_resume_restore);
+
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index a39ed5c..853672f 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -14,6 +14,9 @@
 #ifndef __POWERPC_FSL_PCI_H
 #define __POWERPC_FSL_PCI_H
 
+#define PCIE_POW_NUMBER	5
+#define PCIE_PIW_NUMBER	4
+
 #define PCIE_LTSSM	0x0404		/* PCIE Link Training and Status */
 #define PCIE_LTSSM_L0	0x16		/* L0 state */
 #define PIWAR_EN		0x80000000	/* Enable */
@@ -64,7 +67,7 @@ struct ccsr_pci {
  * The default outbound register set is used when a transaction misses
  * in all of the other outbound windows.
  */
-	struct pci_outbound_window_regs pow[5];
+	struct pci_outbound_window_regs pow[PCIE_POW_NUMBER];
 	u8	res14[96];
 	struct pci_inbound_window_regs	pmit;	/* 0xd00 - 0xd9c Inbound MSI */
 	u8	res6[96];
@@ -72,7 +75,7 @@ struct ccsr_pci {
  * inbound window 1 supports only a 32-bit base address and does not
  * define an inbound window base extended address register.
  */
-	struct pci_inbound_window_regs piw[4];
+	struct pci_inbound_window_regs piw[PCIE_PIW_NUMBER];
 
 	__be32	pex_err_dr;		/* 0x.e00 - PCI/PCIE error detect register */
 	u8	res21[4];
-- 
1.7.3

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

* Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-04-28  6:38 [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM Prabhakar Kushwaha
@ 2011-05-19  6:30 ` Kumar Gala
  2011-05-19 11:22   ` Kushwaha Prabhakar-B32579
  0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gala @ 2011-05-19  6:30 UTC (permalink / raw)
  To: Prabhakar Kushwaha; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang


On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:

> D3-cold state indicates removal of the clock and power. however =
auxiliary (AUX)
> Power may remain available even after the main power rails are powered =
down.
>=20
> wakeup from D3-cold state requires full context restore. Other things =
are taken
> care in pci-driver except ATMUs.
> ATMU windows needs to be saved and restored during suspend and resume.
>=20
> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
> Based upon =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(branc=
h master)
>=20
> arch/powerpc/sysdev/fsl_pci.c |  116 =
+++++++++++++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
> 2 files changed, 121 insertions(+), 2 deletions(-)

Is this patch for when we are a host or agent?

- k=

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

* RE: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-19  6:30 ` Kumar Gala
@ 2011-05-19 11:22   ` Kushwaha Prabhakar-B32579
  2011-05-19 13:22     ` Kumar Gala
  0 siblings, 1 reply; 9+ messages in thread
From: Kushwaha Prabhakar-B32579 @ 2011-05-19 11:22 UTC (permalink / raw)
  To: Kumar Gala; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898

Hi Kumar,
  Please find my answer in-lined

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Thursday, May 19, 2011 12:00 PM
> To: Kushwaha Prabhakar-B32579
> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang Yutang-
> B14898
> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for
> PM
>=20
>=20
> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
>=20
> > D3-cold state indicates removal of the clock and power. however
> > auxiliary (AUX) Power may remain available even after the main power
> rails are powered down.
> >
> > wakeup from D3-cold state requires full context restore. Other things
> > are taken care in pci-driver except ATMUs.
> > ATMU windows needs to be saved and restored during suspend and resume.
> >
> > Signed-off-by: Jiang Yutang <b14898@freescale.com>
> > Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> > ---
> > Based upon
> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(b
> > ranch master)
> >
> > arch/powerpc/sysdev/fsl_pci.c |  116
> +++++++++++++++++++++++++++++++++++++++++
> > arch/powerpc/sysdev/fsl_pci.h |    7 ++-
> > 2 files changed, 121 insertions(+), 2 deletions(-)
>=20
> Is this patch for when we are a host or agent?

This patch is independent of host or agent. It is for supporting D3 cold st=
ate for P1022.
These functions are called during System level suspend and resume.=20

--Prabhakar

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

* Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-19 11:22   ` Kushwaha Prabhakar-B32579
@ 2011-05-19 13:22     ` Kumar Gala
  2011-05-20  4:41       ` Kushwaha Prabhakar-B32579
  0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gala @ 2011-05-19 13:22 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898


On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:

> Hi Kumar,
>  Please find my answer in-lined
>=20
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, May 19, 2011 12:00 PM
>> To: Kushwaha Prabhakar-B32579
>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang =
Yutang-
>> B14898
>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows =
for
>> PM
>>=20
>>=20
>> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
>>=20
>>> D3-cold state indicates removal of the clock and power. however
>>> auxiliary (AUX) Power may remain available even after the main power
>> rails are powered down.
>>>=20
>>> wakeup from D3-cold state requires full context restore. Other =
things
>>> are taken care in pci-driver except ATMUs.
>>> ATMU windows needs to be saved and restored during suspend and =
resume.
>>>=20
>>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
>>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>>> ---
>>> Based upon
>>> =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git(b
>>> ranch master)
>>>=20
>>> arch/powerpc/sysdev/fsl_pci.c |  116
>> +++++++++++++++++++++++++++++++++++++++++
>>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
>>> 2 files changed, 121 insertions(+), 2 deletions(-)
>>=20
>> Is this patch for when we are a host or agent?
>=20
> This patch is independent of host or agent. It is for supporting D3 =
cold state for P1022.
> These functions are called during System level suspend and resume.=20
>=20
> --Prabhakar

I'm trying to figure out why this is limited to P1022.

- k=

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

* RE: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-19 13:22     ` Kumar Gala
@ 2011-05-20  4:41       ` Kushwaha Prabhakar-B32579
  2011-05-20  4:46         ` Kumar Gala
  2011-05-20  4:48         ` Kumar Gala
  0 siblings, 2 replies; 9+ messages in thread
From: Kushwaha Prabhakar-B32579 @ 2011-05-20  4:41 UTC (permalink / raw)
  To: Kumar Gala; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898



> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Thursday, May 19, 2011 6:53 PM
> To: Kushwaha Prabhakar-B32579
> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang Yutang-
> B14898
> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for
> PM
>=20
>=20
> On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:
>=20
> > Hi Kumar,
> >  Please find my answer in-lined
> >
> >> -----Original Message-----
> >> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> >> Sent: Thursday, May 19, 2011 12:00 PM
> >> To: Kushwaha Prabhakar-B32579
> >> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
> >> Yutang-
> >> B14898
> >> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows
> >> for PM
> >>
> >>
> >> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
> >>
> >>> D3-cold state indicates removal of the clock and power. however
> >>> auxiliary (AUX) Power may remain available even after the main power
> >> rails are powered down.
> >>>
> >>> wakeup from D3-cold state requires full context restore. Other
> >>> things are taken care in pci-driver except ATMUs.
> >>> ATMU windows needs to be saved and restored during suspend and
> resume.
> >>>
> >>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> >>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> >>> ---
> >>> Based upon
> >>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> >>> (b
> >>> ranch master)
> >>>
> >>> arch/powerpc/sysdev/fsl_pci.c |  116
> >> +++++++++++++++++++++++++++++++++++++++++
> >>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
> >>> 2 files changed, 121 insertions(+), 2 deletions(-)
> >>
> >> Is this patch for when we are a host or agent?
> >
> > This patch is independent of host or agent. It is for supporting D3
> cold state for P1022.
> > These functions are called during System level suspend and resume.
> >
> > --Prabhakar
>=20
> I'm trying to figure out why this is limited to P1022.

Till now, No SOC was supporting D3 cold state. First time P1022 supporting =
it.
Note:  D3 cold state =3D=3D PCIe block Power down

--Prabhakar=20

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

* Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-20  4:41       ` Kushwaha Prabhakar-B32579
@ 2011-05-20  4:46         ` Kumar Gala
  2011-05-20  4:48         ` Kumar Gala
  1 sibling, 0 replies; 9+ messages in thread
From: Kumar Gala @ 2011-05-20  4:46 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898


On May 19, 2011, at 11:41 PM, Kushwaha Prabhakar-B32579 wrote:

>=20
>=20
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, May 19, 2011 6:53 PM
>> To: Kushwaha Prabhakar-B32579
>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang =
Yutang-
>> B14898
>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows =
for
>> PM
>>=20
>>=20
>> On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:
>>=20
>>> Hi Kumar,
>>> Please find my answer in-lined
>>>=20
>>>> -----Original Message-----
>>>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>>>> Sent: Thursday, May 19, 2011 12:00 PM
>>>> To: Kushwaha Prabhakar-B32579
>>>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
>>>> Yutang-
>>>> B14898
>>>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU =
windows
>>>> for PM
>>>>=20
>>>>=20
>>>> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
>>>>=20
>>>>> D3-cold state indicates removal of the clock and power. however
>>>>> auxiliary (AUX) Power may remain available even after the main =
power
>>>> rails are powered down.
>>>>>=20
>>>>> wakeup from D3-cold state requires full context restore. Other
>>>>> things are taken care in pci-driver except ATMUs.
>>>>> ATMU windows needs to be saved and restored during suspend and
>> resume.
>>>>>=20
>>>>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
>>>>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>>>>> ---
>>>>> Based upon
>>>>> =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>>>>> (b
>>>>> ranch master)
>>>>>=20
>>>>> arch/powerpc/sysdev/fsl_pci.c |  116
>>>> +++++++++++++++++++++++++++++++++++++++++
>>>>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
>>>>> 2 files changed, 121 insertions(+), 2 deletions(-)
>>>>=20
>>>> Is this patch for when we are a host or agent?
>>>=20
>>> This patch is independent of host or agent. It is for supporting D3
>> cold state for P1022.
>>> These functions are called during System level suspend and resume.
>>>=20
>>> --Prabhakar
>>=20
>> I'm trying to figure out why this is limited to P1022.
>=20
> Till now, No SOC was supporting D3 cold state. First time P1022 =
supporting it.
> Note:  D3 cold state =3D=3D PCIe block Power down
>=20
> --Prabhakar=20

how do we test this ?

- k=

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

* Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-20  4:41       ` Kushwaha Prabhakar-B32579
  2011-05-20  4:46         ` Kumar Gala
@ 2011-05-20  4:48         ` Kumar Gala
  2011-05-20  5:01           ` Kushwaha Prabhakar-B32579
  1 sibling, 1 reply; 9+ messages in thread
From: Kumar Gala @ 2011-05-20  4:48 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898


On May 19, 2011, at 11:41 PM, Kushwaha Prabhakar-B32579 wrote:

>=20
>=20
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, May 19, 2011 6:53 PM
>> To: Kushwaha Prabhakar-B32579
>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang =
Yutang-
>> B14898
>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows =
for
>> PM
>>=20
>>=20
>> On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:
>>=20
>>> Hi Kumar,
>>> Please find my answer in-lined
>>>=20
>>>> -----Original Message-----
>>>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>>>> Sent: Thursday, May 19, 2011 12:00 PM
>>>> To: Kushwaha Prabhakar-B32579
>>>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
>>>> Yutang-
>>>> B14898
>>>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU =
windows
>>>> for PM
>>>>=20
>>>>=20
>>>> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
>>>>=20
>>>>> D3-cold state indicates removal of the clock and power. however
>>>>> auxiliary (AUX) Power may remain available even after the main =
power
>>>> rails are powered down.
>>>>>=20
>>>>> wakeup from D3-cold state requires full context restore. Other
>>>>> things are taken care in pci-driver except ATMUs.
>>>>> ATMU windows needs to be saved and restored during suspend and
>> resume.
>>>>>=20
>>>>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
>>>>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>>>>> ---
>>>>> Based upon
>>>>> =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>>>>> (b
>>>>> ranch master)
>>>>>=20
>>>>> arch/powerpc/sysdev/fsl_pci.c |  116
>>>> +++++++++++++++++++++++++++++++++++++++++
>>>>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
>>>>> 2 files changed, 121 insertions(+), 2 deletions(-)
>>>>=20
>>>> Is this patch for when we are a host or agent?
>>>=20
>>> This patch is independent of host or agent. It is for supporting D3
>> cold state for P1022.
>>> These functions are called during System level suspend and resume.
>>>=20
>>> --Prabhakar
>>=20
>> I'm trying to figure out why this is limited to P1022.
>=20
> Till now, No SOC was supporting D3 cold state. First time P1022 =
supporting it.
> Note:  D3 cold state =3D=3D PCIe block Power down
>=20

I'm wondering a few things:

1. Is there any reason not to do this for ALL FSL PCIe SoCs?
2. why do bother saving state, we don't we re-parse the .dts and =
reconfigure ATMUs that way?

- k

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

* RE: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-20  4:48         ` Kumar Gala
@ 2011-05-20  5:01           ` Kushwaha Prabhakar-B32579
  2011-05-20  5:15             ` Kumar Gala
  0 siblings, 1 reply; 9+ messages in thread
From: Kushwaha Prabhakar-B32579 @ 2011-05-20  5:01 UTC (permalink / raw)
  To: Kumar Gala; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898



> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Friday, May 20, 2011 10:19 AM
> To: Kushwaha Prabhakar-B32579
> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang Yutang-
> B14898
> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for
> PM
>=20
>=20
> On May 19, 2011, at 11:41 PM, Kushwaha Prabhakar-B32579 wrote:
>=20
> >
> >
> >> -----Original Message-----
> >> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> >> Sent: Thursday, May 19, 2011 6:53 PM
> >> To: Kushwaha Prabhakar-B32579
> >> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
> >> Yutang-
> >> B14898
> >> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows
> >> for PM
> >>
> >>
> >> On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:
> >>
> >>> Hi Kumar,
> >>> Please find my answer in-lined
> >>>
> >>>> -----Original Message-----
> >>>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> >>>> Sent: Thursday, May 19, 2011 12:00 PM
> >>>> To: Kushwaha Prabhakar-B32579
> >>>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
> >>>> Yutang-
> >>>> B14898
> >>>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU
> >>>> windows for PM
> >>>>
> >>>>
> >>>> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
> >>>>
> >>>>> D3-cold state indicates removal of the clock and power. however
> >>>>> auxiliary (AUX) Power may remain available even after the main
> >>>>> power
> >>>> rails are powered down.
> >>>>>
> >>>>> wakeup from D3-cold state requires full context restore. Other
> >>>>> things are taken care in pci-driver except ATMUs.
> >>>>> ATMU windows needs to be saved and restored during suspend and
> >> resume.
> >>>>>
> >>>>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> >>>>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> >>>>> ---
> >>>>> Based upon
> >>>>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.g
> >>>>> it
> >>>>> (b
> >>>>> ranch master)
> >>>>>
> >>>>> arch/powerpc/sysdev/fsl_pci.c |  116
> >>>> +++++++++++++++++++++++++++++++++++++++++
> >>>>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
> >>>>> 2 files changed, 121 insertions(+), 2 deletions(-)
> >>>>
> >>>> Is this patch for when we are a host or agent?
> >>>
> >>> This patch is independent of host or agent. It is for supporting D3
> >> cold state for P1022.
> >>> These functions are called during System level suspend and resume.
> >>>
> >>> --Prabhakar
> >>
> >> I'm trying to figure out why this is limited to P1022.
> >
> > Till now, No SOC was supporting D3 cold state. First time P1022
> supporting it.
> > Note:  D3 cold state =3D=3D PCIe block Power down
> >
>=20
> I'm wondering a few things:
>=20
> 1. Is there any reason not to do this for ALL FSL PCIe SoCs?

Yes, I am agree with you. It can be done.=20
But as only P1022 SOC supporting it. There is no use of handling it.=20

> 2. why do bother saving state, we don't we re-parse the .dts and
> reconfigure ATMUs that way?

I also thought of this case. But Agent use case scenario forbid me to do th=
is.=20
As ATMU's are programmed by host depending upon different use case . And th=
is information is never stored in the dts.

--Prabhakar



=20

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

* Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM
  2011-05-20  5:01           ` Kushwaha Prabhakar-B32579
@ 2011-05-20  5:15             ` Kumar Gala
  0 siblings, 0 replies; 9+ messages in thread
From: Kumar Gala @ 2011-05-20  5:15 UTC (permalink / raw)
  To: Kushwaha Prabhakar-B32579; +Cc: meet2prabhu, linuxppc-dev, Jiang Yutang-B14898


On May 20, 2011, at 12:01 AM, Kushwaha Prabhakar-B32579 wrote:

>=20
>=20
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Friday, May 20, 2011 10:19 AM
>> To: Kushwaha Prabhakar-B32579
>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang =
Yutang-
>> B14898
>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU windows =
for
>> PM
>>=20
>>=20
>> On May 19, 2011, at 11:41 PM, Kushwaha Prabhakar-B32579 wrote:
>>=20
>>>=20
>>>=20
>>>> -----Original Message-----
>>>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>>>> Sent: Thursday, May 19, 2011 6:53 PM
>>>> To: Kushwaha Prabhakar-B32579
>>>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
>>>> Yutang-
>>>> B14898
>>>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU =
windows
>>>> for PM
>>>>=20
>>>>=20
>>>> On May 19, 2011, at 6:22 AM, Kushwaha Prabhakar-B32579 wrote:
>>>>=20
>>>>> Hi Kumar,
>>>>> Please find my answer in-lined
>>>>>=20
>>>>>> -----Original Message-----
>>>>>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>>>>>> Sent: Thursday, May 19, 2011 12:00 PM
>>>>>> To: Kushwaha Prabhakar-B32579
>>>>>> Cc: linuxppc-dev@lists.ozlabs.org; meet2prabhu@gmail.com; Jiang
>>>>>> Yutang-
>>>>>> B14898
>>>>>> Subject: Re: [PATCH] powerpc/85xx: Save and restore pcie ATMU
>>>>>> windows for PM
>>>>>>=20
>>>>>>=20
>>>>>> On Apr 28, 2011, at 1:38 AM, Prabhakar Kushwaha wrote:
>>>>>>=20
>>>>>>> D3-cold state indicates removal of the clock and power. however
>>>>>>> auxiliary (AUX) Power may remain available even after the main
>>>>>>> power
>>>>>> rails are powered down.
>>>>>>>=20
>>>>>>> wakeup from D3-cold state requires full context restore. Other
>>>>>>> things are taken care in pci-driver except ATMUs.
>>>>>>> ATMU windows needs to be saved and restored during suspend and
>>>> resume.
>>>>>>>=20
>>>>>>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
>>>>>>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>>>>>>> ---
>>>>>>> Based upon
>>>>>>> =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.g
>>>>>>> it
>>>>>>> (b
>>>>>>> ranch master)
>>>>>>>=20
>>>>>>> arch/powerpc/sysdev/fsl_pci.c |  116
>>>>>> +++++++++++++++++++++++++++++++++++++++++
>>>>>>> arch/powerpc/sysdev/fsl_pci.h |    7 ++-
>>>>>>> 2 files changed, 121 insertions(+), 2 deletions(-)
>>>>>>=20
>>>>>> Is this patch for when we are a host or agent?
>>>>>=20
>>>>> This patch is independent of host or agent. It is for supporting =
D3
>>>> cold state for P1022.
>>>>> These functions are called during System level suspend and resume.
>>>>>=20
>>>>> --Prabhakar
>>>>=20
>>>> I'm trying to figure out why this is limited to P1022.
>>>=20
>>> Till now, No SOC was supporting D3 cold state. First time P1022
>> supporting it.
>>> Note:  D3 cold state =3D=3D PCIe block Power down
>>>=20
>>=20
>> I'm wondering a few things:
>>=20
>> 1. Is there any reason not to do this for ALL FSL PCIe SoCs?
>=20
> Yes, I am agree with you. It can be done.=20
> But as only P1022 SOC supporting it. There is no use of handling it.

I'm also not clear if the DECLARE_PCI_FIXUP_SUSPEND() is the right way =
for us to connect up these suspend/resume functions.

>> 2. why do bother saving state, we don't we re-parse the .dts and
>> reconfigure ATMUs that way?
>=20
> I also thought of this case. But Agent use case scenario forbid me to =
do this.=20
> As ATMU's are programmed by host depending upon different use case . =
And this information is never stored in the dts.

Fair point, but in agent mode will this code ever really be called?  It =
seems like we'd never register ourselves with the PCI subsystem so how =
would this get called?

- k=

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

end of thread, other threads:[~2011-05-20  5:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-28  6:38 [PATCH] powerpc/85xx: Save and restore pcie ATMU windows for PM Prabhakar Kushwaha
2011-05-19  6:30 ` Kumar Gala
2011-05-19 11:22   ` Kushwaha Prabhakar-B32579
2011-05-19 13:22     ` Kumar Gala
2011-05-20  4:41       ` Kushwaha Prabhakar-B32579
2011-05-20  4:46         ` Kumar Gala
2011-05-20  4:48         ` Kumar Gala
2011-05-20  5:01           ` Kushwaha Prabhakar-B32579
2011-05-20  5:15             ` Kumar Gala

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.