* [PATCH] soc: imx: gpcv2: correct PGC offset
@ 2018-05-29 8:02 Anson Huang
2018-05-29 14:02 ` Leonard Crestez
2018-05-29 23:11 ` Andrey Smirnov
0 siblings, 2 replies; 6+ messages in thread
From: Anson Huang @ 2018-05-29 8:02 UTC (permalink / raw)
To: shawnguo, s.hauer, kernel, fabio.estevam
Cc: Linux-imx, linux-arm-kernel, linux-kernel
Correct MIPI/PCIe/USB_HSIC's PGC offset based on
design RTL, the value on Reference Manual are incorrect.
The correct offset should be as below:
0x800 ~ 0x83F: PGC for core0 of A7 platform;
0x840 ~ 0x87F: PGC for core1 of A7 platform;
0x880 ~ 0x8BF: PGC for SCU of A7 platform;
0xA00 ~ 0xA3F: PGC for fastmix/megamix;
0xC00 ~ 0xC3F: PGC for MIPI PHY;
0xC40 ~ 0xC7F: PGC for PCIe_PHY;
0xC80 ~ 0xCBF: PGC for USB OTG1 PHY;
0xCC0 ~ 0xCFF: PGC for USB OTG2 PHY;
0xD00 ~ 0xD3F: PGC for USB HSIC PHY;
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/soc/imx/gpcv2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index afc7ecc..132c946 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -40,9 +40,9 @@
#define GPC_M4_PU_PDN_FLG 0x1bc
-#define PGC_MIPI 4
-#define PGC_PCIE 5
-#define PGC_USB_HSIC 8
+#define PGC_MIPI 16
+#define PGC_PCIE 17
+#define PGC_USB_HSIC 20
#define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40)
#define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: imx: gpcv2: correct PGC offset
2018-05-29 8:02 [PATCH] soc: imx: gpcv2: correct PGC offset Anson Huang
@ 2018-05-29 14:02 ` Leonard Crestez
2018-05-29 23:16 ` Andrey Smirnov
2018-05-30 1:38 ` Anson Huang
2018-05-29 23:11 ` Andrey Smirnov
1 sibling, 2 replies; 6+ messages in thread
From: Leonard Crestez @ 2018-05-29 14:02 UTC (permalink / raw)
To: Anson Huang, shawnguo, Andrey Smirnov
Cc: Linux-imx, linux-arm-kernel, linux-kernel, s.hauer, kernel,
fabio.estevam, Abel Vesa, Richard Liu
On Tue, 2018-05-29 at 16:02 +0800, Anson Huang wrote:
> Correct MIPI/PCIe/USB_HSIC's PGC offset based on
> design RTL, the value on Reference Manual are incorrect.
>
> The correct offset should be as below:
>
> -#define PGC_MIPI 4
> -#define PGC_PCIE 5
> -#define PGC_USB_HSIC 8
> +#define PGC_MIPI 16
> +#define PGC_PCIE 17
> +#define PGC_USB_HSIC 20
> #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40)
> #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc)
This gpcv2 driver is currently only used for PCI, it probably only
works because domains happen to be turned on by default?
On imx7d upstream platform suspend is not yet supported but even doing
device-level suspend causes a hang on resume somewhere in PCI on first
read. This patch fixes that immediate hang.
After suspend/resume lspci is broken (device doesn't properly resume),
that probably requires more imx pci patches and unrelated to pgc.
--
Regards,
Leonard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: imx: gpcv2: correct PGC offset
2018-05-29 14:02 ` Leonard Crestez
@ 2018-05-29 23:16 ` Andrey Smirnov
2018-05-30 1:38 ` Anson Huang
1 sibling, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-05-29 23:16 UTC (permalink / raw)
To: Leonard Crestez
Cc: Anson Huang, Shawn Guo, Linux-imx, linux-arm-kernel,
linux-kernel, Sascha Hauer, Sascha Hauer, Fabio Estevam,
Abel Vesa, Richard Liu
On Tue, May 29, 2018 at 7:02 AM, Leonard Crestez
<leonard.crestez@nxp.com> wrote:
> On Tue, 2018-05-29 at 16:02 +0800, Anson Huang wrote:
>> Correct MIPI/PCIe/USB_HSIC's PGC offset based on
>> design RTL, the value on Reference Manual are incorrect.
>>
>> The correct offset should be as below:
>>
>> -#define PGC_MIPI 4
>> -#define PGC_PCIE 5
>> -#define PGC_USB_HSIC 8
>> +#define PGC_MIPI 16
>> +#define PGC_PCIE 17
>> +#define PGC_USB_HSIC 20
>> #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40)
>> #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc)
>
> This gpcv2 driver is currently only used for PCI, it probably only
> works because domains happen to be turned on by default?
>
That'd be my guess as well. I just tried commenting all of the code
related to GPC_PGC_CTRL in gpcv2 drive and PCIe still worked on my
SabreSD board.
> On imx7d upstream platform suspend is not yet supported but even doing
> device-level suspend causes a hang on resume somewhere in PCI on first
> read. This patch fixes that immediate hang.
>
> After suspend/resume lspci is broken (device doesn't properly resume),
> that probably requires more imx pci patches and unrelated to pgc.
>
Yeah, suspend of any kind was not a part of the use-case for me when I
was working on this driver, so it's not surprising to hear that it
doesn't work very well.
Thanks,
Andrey Smirnov
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] soc: imx: gpcv2: correct PGC offset
2018-05-29 14:02 ` Leonard Crestez
2018-05-29 23:16 ` Andrey Smirnov
@ 2018-05-30 1:38 ` Anson Huang
1 sibling, 0 replies; 6+ messages in thread
From: Anson Huang @ 2018-05-30 1:38 UTC (permalink / raw)
To: Leonard Crestez, shawnguo, Andrey Smirnov
Cc: dl-linux-imx, linux-arm-kernel, linux-kernel, s.hauer, kernel,
Fabio Estevam, Abel Vesa, Richard Liu
Hi, Leonard
Anson Huang
Best Regards!
> -----Original Message-----
> From: Leonard Crestez
> Sent: Tuesday, May 29, 2018 10:03 PM
> To: Anson Huang <anson.huang@nxp.com>; shawnguo@kernel.org; Andrey
> Smirnov <andrew.smirnov@gmail.com>
> Cc: dl-linux-imx <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; s.hauer@pengutronix.de;
> kernel@pengutronix.de; Fabio Estevam <fabio.estevam@nxp.com>; Abel Vesa
> <abel.vesa@nxp.com>; Richard Liu <xuegang.liu@nxp.com>
> Subject: Re: [PATCH] soc: imx: gpcv2: correct PGC offset
>
> On Tue, 2018-05-29 at 16:02 +0800, Anson Huang wrote:
> > Correct MIPI/PCIe/USB_HSIC's PGC offset based on design RTL, the value
> > on Reference Manual are incorrect.
> >
> > The correct offset should be as below:
> >
> > -#define PGC_MIPI 4
> > -#define PGC_PCIE 5
> > -#define PGC_USB_HSIC 8
> > +#define PGC_MIPI 16
> > +#define PGC_PCIE 17
> > +#define PGC_USB_HSIC 20
> > #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40)
> > #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc)
>
> This gpcv2 driver is currently only used for PCI, it probably only works because
> domains happen to be turned on by default?
I think so.
>
> On imx7d upstream platform suspend is not yet supported but even doing
> device-level suspend causes a hang on resume somewhere in PCI on first read.
> This patch fixes that immediate hang.
I just added the imx7d platform suspend/resume support using psci in u-boot, patches
are sent out for review.
I did notice PCI resume cause system hang, the root cause is PCI controller registers
can NOT be accessed after resume, and the PCI PHY PLL is NOT locked when issue happen,
the PCI driver should implement suspend/resume and redo the init flow after resume, since
its power VDD1P0D are OFF after suspend.
I saw you sent out patch to fix it, thanks.
Anson.
>
> After suspend/resume lspci is broken (device doesn't properly resume), that
> probably requires more imx pci patches and unrelated to pgc.
>
> --
> Regards,
> Leonard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: imx: gpcv2: correct PGC offset
2018-05-29 8:02 [PATCH] soc: imx: gpcv2: correct PGC offset Anson Huang
2018-05-29 14:02 ` Leonard Crestez
@ 2018-05-29 23:11 ` Andrey Smirnov
2018-05-30 1:00 ` Anson Huang
1 sibling, 1 reply; 6+ messages in thread
From: Andrey Smirnov @ 2018-05-29 23:11 UTC (permalink / raw)
To: Anson Huang
Cc: Shawn Guo, Sascha Hauer, Sascha Hauer, Fabio Estevam, Linux-imx,
linux-arm-kernel, linux-kernel
On Tue, May 29, 2018 at 1:02 AM, Anson Huang <Anson.Huang@nxp.com> wrote:
> Correct MIPI/PCIe/USB_HSIC's PGC offset based on
> design RTL, the value on Reference Manual are incorrect.
>
Nit: I'd s/the value on/the values in the/ here.
> The correct offset should be as below:
>
> 0x800 ~ 0x83F: PGC for core0 of A7 platform;
> 0x840 ~ 0x87F: PGC for core1 of A7 platform;
> 0x880 ~ 0x8BF: PGC for SCU of A7 platform;
> 0xA00 ~ 0xA3F: PGC for fastmix/megamix;
> 0xC00 ~ 0xC3F: PGC for MIPI PHY;
> 0xC40 ~ 0xC7F: PGC for PCIe_PHY;
> 0xC80 ~ 0xCBF: PGC for USB OTG1 PHY;
> 0xCC0 ~ 0xCFF: PGC for USB OTG2 PHY;
> 0xD00 ~ 0xD3F: PGC for USB HSIC PHY;
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> drivers/soc/imx/gpcv2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
> index afc7ecc..132c946 100644
> --- a/drivers/soc/imx/gpcv2.c
> +++ b/drivers/soc/imx/gpcv2.c
> @@ -40,9 +40,9 @@
> #define GPC_M4_PU_PDN_FLG 0x1bc
>
>
> -#define PGC_MIPI 4
> -#define PGC_PCIE 5
> -#define PGC_USB_HSIC 8
> +#define PGC_MIPI 16
> +#define PGC_PCIE 17
> +#define PGC_USB_HSIC 20
As a suggestion, please add a comment explicitly saying that those
values might differ from what some version of the RM might specify.
Explanation in commit message is great, but seeing a note in the code
might save quite a bit of digging for someone who is reading the code,
double checking those values and thinking that they might be wrong.
Other than that:
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Thanks,
Andrey Smirnov
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] soc: imx: gpcv2: correct PGC offset
2018-05-29 23:11 ` Andrey Smirnov
@ 2018-05-30 1:00 ` Anson Huang
0 siblings, 0 replies; 6+ messages in thread
From: Anson Huang @ 2018-05-30 1:00 UTC (permalink / raw)
To: Andrey Smirnov
Cc: Shawn Guo, Sascha Hauer, Sascha Hauer, Fabio Estevam,
dl-linux-imx, linux-arm-kernel, linux-kernel
Hi, Andrey
Anson Huang
Best Regards!
> -----Original Message-----
> From: Andrey Smirnov [mailto:andrew.smirnov@gmail.com]
> Sent: Wednesday, May 30, 2018 7:11 AM
> To: Anson Huang <anson.huang@nxp.com>
> Cc: Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> <s.hauer@pengutronix.de>; Sascha Hauer <kernel@pengutronix.de>; Fabio
> Estevam <fabio.estevam@nxp.com>; dl-linux-imx <linux-imx@nxp.com>;
> linux-arm-kernel <linux-arm-kernel@lists.infradead.org>; linux-kernel
> <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH] soc: imx: gpcv2: correct PGC offset
>
> On Tue, May 29, 2018 at 1:02 AM, Anson Huang <Anson.Huang@nxp.com>
> wrote:
> > Correct MIPI/PCIe/USB_HSIC's PGC offset based on design RTL, the value
> > on Reference Manual are incorrect.
> >
>
> Nit: I'd s/the value on/the values in the/ here.
>
> > The correct offset should be as below:
> >
> > 0x800 ~ 0x83F: PGC for core0 of A7 platform;
> > 0x840 ~ 0x87F: PGC for core1 of A7 platform;
> > 0x880 ~ 0x8BF: PGC for SCU of A7 platform;
> > 0xA00 ~ 0xA3F: PGC for fastmix/megamix;
> > 0xC00 ~ 0xC3F: PGC for MIPI PHY;
> > 0xC40 ~ 0xC7F: PGC for PCIe_PHY;
> > 0xC80 ~ 0xCBF: PGC for USB OTG1 PHY;
> > 0xCC0 ~ 0xCFF: PGC for USB OTG2 PHY;
> > 0xD00 ~ 0xD3F: PGC for USB HSIC PHY;
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > drivers/soc/imx/gpcv2.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index
> > afc7ecc..132c946 100644
> > --- a/drivers/soc/imx/gpcv2.c
> > +++ b/drivers/soc/imx/gpcv2.c
> > @@ -40,9 +40,9 @@
> > #define GPC_M4_PU_PDN_FLG 0x1bc
> >
> >
> > -#define PGC_MIPI 4
> > -#define PGC_PCIE 5
> > -#define PGC_USB_HSIC 8
> > +#define PGC_MIPI 16
> > +#define PGC_PCIE 17
> > +#define PGC_USB_HSIC 20
>
> As a suggestion, please add a comment explicitly saying that those values
> might differ from what some version of the RM might specify.
> Explanation in commit message is great, but seeing a note in the code might
> save quite a bit of digging for someone who is reading the code, double
> checking those values and thinking that they might be wrong.
>
> Other than that:
>
> Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>
> Thanks,
> Andrey Smirnov
Thanks, I will improve them in V2 patch.
Anson.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-30 1:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 8:02 [PATCH] soc: imx: gpcv2: correct PGC offset Anson Huang
2018-05-29 14:02 ` Leonard Crestez
2018-05-29 23:16 ` Andrey Smirnov
2018-05-30 1:38 ` Anson Huang
2018-05-29 23:11 ` Andrey Smirnov
2018-05-30 1:00 ` Anson Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®