2020-04-15 23:56:19

by Peng Fan

[permalink] [raw]
Subject: [PATCH V4 0/4] ARM: imx7ulp: support HSRUN mode

From: Peng Fan <[email protected]>

V4:
Fix dt_bindings check
The same patchset was wrongly posted as V2,
https://patchwork.kernel.org/cover/11485107/

This is a splited part from V2:
ARM: imx7ulp: add cpufreq using cpufreq-dt
https://patchwork.kernel.org/cover/11390589/
Nothing changed

The original V2 patchset is to support i.MX7ULP cpufreq,
still waiting the virtual clk being accepted. so to decouple,
this patchset only takes the run mode part.

Peng Fan (4):
dt-bindings: fsl: add i.MX7ULP PMC binding doc
ARM: dts: imx7ulp: add pmc node
ARM: imx: imx7ulp: support HSRUN mode
ARM: imx: cpuidle-imx7ulp: Stop mode disallowed when HSRUN

.../bindings/arm/freescale/imx7ulp_pmc.yaml | 32 ++++++++++++++++++++++
arch/arm/boot/dts/imx7ulp.dtsi | 10 +++++++
arch/arm/mach-imx/common.h | 1 +
arch/arm/mach-imx/cpuidle-imx7ulp.c | 14 ++++++++--
arch/arm/mach-imx/pm-imx7ulp.c | 25 +++++++++++++++++
5 files changed, 79 insertions(+), 3 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/freescale/imx7ulp_pmc.yaml

--
2.16.4


2020-04-15 23:56:38

by Peng Fan

[permalink] [raw]
Subject: [PATCH V4 3/4] ARM: imx: imx7ulp: support HSRUN mode

From: Peng Fan <[email protected]>

Configure PMPROT to let ARM core could run into HSRUN mode.
In LDO-enabled mode, HSRUN mode is not allowed, so add a check before
configure PMPROT.

Signed-off-by: Peng Fan <[email protected]>
---
arch/arm/mach-imx/pm-imx7ulp.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-imx/pm-imx7ulp.c b/arch/arm/mach-imx/pm-imx7ulp.c
index 2e756d8191fa..393faf1e8382 100644
--- a/arch/arm/mach-imx/pm-imx7ulp.c
+++ b/arch/arm/mach-imx/pm-imx7ulp.c
@@ -11,6 +11,10 @@

#include "common.h"

+#define PMC0_CTRL 0x28
+#define BM_CTRL_LDOEN BIT(31)
+
+#define SMC_PMPROT 0x8
#define SMC_PMCTRL 0x10
#define BP_PMCTRL_PSTOPO 16
#define PSTOPO_PSTOP3 0x3
@@ -25,7 +29,10 @@
#define BM_PMCTRL_RUNM (3 << BP_PMCTRL_RUNM)
#define BM_PMCTRL_STOPM (7 << BP_PMCTRL_STOPM)

+#define BM_PMPROT_AHSRUN BIT(7)
+
static void __iomem *smc1_base;
+static void __iomem *pmc0_base;

int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode)
{
@@ -65,5 +72,13 @@ void __init imx7ulp_pm_init(void)
of_node_put(np);
WARN_ON(!smc1_base);

+ np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-pmc0");
+ pmc0_base = of_iomap(np, 0);
+ WARN_ON(!pmc0_base);
+ of_node_put(np);
+
+ if (!(readl_relaxed(pmc0_base + PMC0_CTRL) & BM_CTRL_LDOEN))
+ writel_relaxed(BM_PMPROT_AHSRUN, smc1_base + SMC_PMPROT);
+
imx7ulp_set_lpm(ULP_PM_RUN);
}
--
2.16.4

2020-04-15 23:56:50

by Peng Fan

[permalink] [raw]
Subject: [PATCH V4 2/4] ARM: dts: imx7ulp: add pmc node

From: Peng Fan <[email protected]>

Add i.MX7ULP pmc0/1 node

Signed-off-by: Peng Fan <[email protected]>
---
arch/arm/boot/dts/imx7ulp.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi
index f7c4878534c8..bc9d692c0530 100644
--- a/arch/arm/boot/dts/imx7ulp.dtsi
+++ b/arch/arm/boot/dts/imx7ulp.dtsi
@@ -286,6 +286,11 @@
assigned-clock-parents = <&scg1 IMX7ULP_CLK_SOSC_BUS_CLK>;
};

+ pmc1: pmc1@40400000 {
+ compatible = "fsl,imx7ulp-pmc1";
+ reg = <0x40400000 0x1000>;
+ };
+
smc1: clock-controller@40410000 {
compatible = "fsl,imx7ulp-smc1";
reg = <0x40410000 0x1000>;
@@ -447,6 +452,11 @@
reg = <0x41080000 0x80000>;
ranges;

+ pmc0: pmc0@410a1000 {
+ compatible = "fsl,imx7ulp-pmc0";
+ reg = <0x410a1000 0x1000>;
+ };
+
sim: sim@410a3000 {
compatible = "fsl,imx7ulp-sim", "syscon";
reg = <0x410a3000 0x1000>;
--
2.16.4

2020-05-07 06:30:48

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH V4 0/4] ARM: imx7ulp: support HSRUN mode

> Subject: [PATCH V4 0/4] ARM: imx7ulp: support HSRUN mode

Ping..

Thanks,
Peng.

>
> From: Peng Fan <[email protected]>
>
> V4:
> Fix dt_bindings check
> The same patchset was wrongly posted as V2,
> https://patchwork.kernel.org/cover/11485107/
>
> This is a splited part from V2:
> ARM: imx7ulp: add cpufreq using cpufreq-dt
> https://patchwork.kernel.org/cover/11390589/
> Nothing changed
>
> The original V2 patchset is to support i.MX7ULP cpufreq, still waiting the
> virtual clk being accepted. so to decouple, this patchset only takes the run
> mode part.
>
> Peng Fan (4):
> dt-bindings: fsl: add i.MX7ULP PMC binding doc
> ARM: dts: imx7ulp: add pmc node
> ARM: imx: imx7ulp: support HSRUN mode
> ARM: imx: cpuidle-imx7ulp: Stop mode disallowed when HSRUN
>
> .../bindings/arm/freescale/imx7ulp_pmc.yaml | 32
> ++++++++++++++++++++++
> arch/arm/boot/dts/imx7ulp.dtsi | 10 +++++++
> arch/arm/mach-imx/common.h | 1 +
> arch/arm/mach-imx/cpuidle-imx7ulp.c | 14 ++++++++--
> arch/arm/mach-imx/pm-imx7ulp.c | 25
> +++++++++++++++++
> 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644
> Documentation/devicetree/bindings/arm/freescale/imx7ulp_pmc.yaml
>
> --
> 2.16.4

2020-05-11 14:27:52

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH V4 0/4] ARM: imx7ulp: support HSRUN mode

On Thu, May 07, 2020 at 06:27:52AM +0000, Peng Fan wrote:
> > Subject: [PATCH V4 0/4] ARM: imx7ulp: support HSRUN mode
>
> Ping..
>
> Thanks,
> Peng.
>
> >
> > From: Peng Fan <[email protected]>
> >
> > V4:
> > Fix dt_bindings check
> > The same patchset was wrongly posted as V2,
> > https://patchwork.kernel.org/cover/11485107/
> >
> > This is a splited part from V2:
> > ARM: imx7ulp: add cpufreq using cpufreq-dt
> > https://patchwork.kernel.org/cover/11390589/
> > Nothing changed
> >
> > The original V2 patchset is to support i.MX7ULP cpufreq, still waiting the
> > virtual clk being accepted. so to decouple, this patchset only takes the run
> > mode part.
> >
> > Peng Fan (4):
> > dt-bindings: fsl: add i.MX7ULP PMC binding doc

Need an ACK from Rob on this new binding.

Shawn

> > ARM: dts: imx7ulp: add pmc node
> > ARM: imx: imx7ulp: support HSRUN mode
> > ARM: imx: cpuidle-imx7ulp: Stop mode disallowed when HSRUN
> >
> > .../bindings/arm/freescale/imx7ulp_pmc.yaml | 32
> > ++++++++++++++++++++++
> > arch/arm/boot/dts/imx7ulp.dtsi | 10 +++++++
> > arch/arm/mach-imx/common.h | 1 +
> > arch/arm/mach-imx/cpuidle-imx7ulp.c | 14 ++++++++--
> > arch/arm/mach-imx/pm-imx7ulp.c | 25
> > +++++++++++++++++
> > 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644
> > Documentation/devicetree/bindings/arm/freescale/imx7ulp_pmc.yaml
> >
> > --
> > 2.16.4
>