2023-05-19 21:18:07

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 0/5] PMU, rpm-stats and IMEM for MSM8226

This series adds PMU, rpm-stats and IMEM nodes for MSM8226.
It also defines and enables reboot modes for samsung,matisse-wifi.

Matti Lehtimäki (5):
dt-bindings: sram: qcom,imem: Document MSM8226
ARM: dts: qcom: msm8226: Add PMU node
ARM: dts: qcom: msm8226: Add rpm-stats device node
ARM: dts: qcom: msm8226: Add IMEM node
ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add reboot-mode node

.../devicetree/bindings/sram/qcom,imem.yaml | 1 +
.../dts/qcom-apq8026-samsung-matisse-wifi.dts | 10 +++++++++
arch/arm/boot/dts/qcom-msm8226.dtsi | 22 +++++++++++++++++++
3 files changed, 33 insertions(+)

--
2.34.1



2023-05-19 21:18:08

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 5/5] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add reboot-mode node

This enables userspace to signal the bootloader to go into the
bootloader or recovery mode.

The magic values can be found in both the downstream kernel and the LK
kernel (bootloader).

Signed-off-by: Matti Lehtimäki <[email protected]>
---
.../arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
index 91b860e24681..a05c41191efd 100644
--- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
+++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
@@ -279,6 +279,16 @@ touchscreen@4a {
};
};

+&imem {
+ status = "okay";
+
+ reboot-mode {
+ mode-bootloader = <0x77665500>;
+ mode-normal = <0x77665501>;
+ mode-recovery = <0x77665502>;
+ };
+};
+
&rpm_requests {
regulators {
compatible = "qcom,rpm-pm8226-regulators";
--
2.34.1


2023-05-19 21:18:15

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 1/5] dt-bindings: sram: qcom,imem: Document MSM8226

Add compatible for MSM8226 IMEM.

Signed-off-by: Matti Lehtimäki <[email protected]>
---
Documentation/devicetree/bindings/sram/qcom,imem.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml
index 0548e8e0d30b..d9599ee51204 100644
--- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml
+++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml
@@ -18,6 +18,7 @@ properties:
items:
- enum:
- qcom,apq8064-imem
+ - qcom,msm8226-imem
- qcom,msm8974-imem
- qcom,qcs404-imem
- qcom,sc7180-imem
--
2.34.1


2023-05-19 21:18:24

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 4/5] ARM: dts: qcom: msm8226: Add IMEM node

This is used for example for reboot-mode which enables userspace to
signal the bootloader to go into the bootloader or recovery mode.

Signed-off-by: Matti Lehtimäki <[email protected]>
---
arch/arm/boot/dts/qcom-msm8226.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 006263373348..3628e48c1ec1 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -646,6 +646,18 @@ smd-edge {
label = "lpass";
};
};
+
+ imem: sram@fe805000 {
+ compatible = "qcom,msm8226-imem", "syscon", "simple-mfd";
+ reg = <0xfe805000 0x1000>;
+
+ status = "disabled";
+
+ reboot-mode {
+ compatible = "syscon-reboot-mode";
+ offset = <0x65c>;
+ };
+ };
};

timer {
--
2.34.1


2023-05-19 21:18:25

by Matti Lehtimäki

[permalink] [raw]
Subject: [PATCH 2/5] ARM: dts: qcom: msm8226: Add PMU node

Enable perf events on MSM8226 devices by adding the PMU node.

Signed-off-by: Matti Lehtimäki <[email protected]>
---
arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
index 42acb9ddb8cc..e272a1e15b44 100644
--- a/arch/arm/boot/dts/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
@@ -47,6 +47,11 @@ scm {
};
};

+ pmu {
+ compatible = "arm,cortex-a7-pmu";
+ interrupts = <GIC_PPI 7 0xf04>;
+ };
+
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
--
2.34.1


2023-05-19 23:31:37

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 4/5] ARM: dts: qcom: msm8226: Add IMEM node



On 19.05.2023 23:09, Matti Lehtimäki wrote:
> This is used for example for reboot-mode which enables userspace to
> signal the bootloader to go into the bootloader or recovery mode.
>
> Signed-off-by: Matti Lehtimäki <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> arch/arm/boot/dts/qcom-msm8226.dtsi | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
> index 006263373348..3628e48c1ec1 100644
> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
> @@ -646,6 +646,18 @@ smd-edge {
> label = "lpass";
> };
> };
> +
> + imem: sram@fe805000 {
> + compatible = "qcom,msm8226-imem", "syscon", "simple-mfd";
> + reg = <0xfe805000 0x1000>;
> +
> + status = "disabled";
> +
> + reboot-mode {
> + compatible = "syscon-reboot-mode";
> + offset = <0x65c>;
> + };
> + };
> };
>
> timer {

2023-05-19 23:33:38

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 5/5] ARM: dts: qcom: apq8026-samsung-matisse-wifi: Add reboot-mode node



On 19.05.2023 23:09, Matti Lehtimäki wrote:
> This enables userspace to signal the bootloader to go into the
> bootloader or recovery mode.
>
> The magic values can be found in both the downstream kernel and the LK
> kernel (bootloader).
>
> Signed-off-by: Matti Lehtimäki <[email protected]>
> ---
> .../arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> index 91b860e24681..a05c41191efd 100644
> --- a/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> +++ b/arch/arm/boot/dts/qcom-apq8026-samsung-matisse-wifi.dts
> @@ -279,6 +279,16 @@ touchscreen@4a {
> };
> };
>
> +&imem {
> + status = "okay";
Drop, undisable in dtsi

> +
> + reboot-mode {
You can add a label like imem_reboot_mode and refer to just this
thing from the device dt. Though I'm fairly sure the modes should
be common.

Konrad
> + mode-bootloader = <0x77665500>;
> + mode-normal = <0x77665501>;
> + mode-recovery = <0x77665502>;
> + };
> +};
> +
> &rpm_requests {
> regulators {
> compatible = "qcom,rpm-pm8226-regulators";

2023-05-19 23:35:00

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 4/5] ARM: dts: qcom: msm8226: Add IMEM node



On 20.05.2023 01:25, Konrad Dybcio wrote:
>
>
> On 19.05.2023 23:09, Matti Lehtimäki wrote:
>> This is used for example for reboot-mode which enables userspace to
>> signal the bootloader to go into the bootloader or recovery mode.
>>
>> Signed-off-by: Matti Lehtimäki <[email protected]>
>> ---
> Reviewed-by: Konrad Dybcio <[email protected]>
Actually, please undisable it. It's always on the SoC and requires
no additional resources.

Konrad
>
> Konrad
>> arch/arm/boot/dts/qcom-msm8226.dtsi | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
>> index 006263373348..3628e48c1ec1 100644
>> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
>> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
>> @@ -646,6 +646,18 @@ smd-edge {
>> label = "lpass";
>> };
>> };
>> +
>> + imem: sram@fe805000 {
>> + compatible = "qcom,msm8226-imem", "syscon", "simple-mfd";
>> + reg = <0xfe805000 0x1000>;
>> +
>> + status = "disabled";
>> +
>> + reboot-mode {
>> + compatible = "syscon-reboot-mode";
>> + offset = <0x65c>;
>> + };
>> + };
>> };
>>
>> timer {

2023-05-19 23:40:37

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/5] ARM: dts: qcom: msm8226: Add PMU node



On 19.05.2023 23:08, Matti Lehtimäki wrote:
> Enable perf events on MSM8226 devices by adding the PMU node.
>
> Signed-off-by: Matti Lehtimäki <[email protected]>
> ---
> arch/arm/boot/dts/qcom-msm8226.dtsi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom-msm8226.dtsi
> index 42acb9ddb8cc..e272a1e15b44 100644
> --- a/arch/arm/boot/dts/qcom-msm8226.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8226.dtsi
> @@ -47,6 +47,11 @@ scm {
> };
> };
>
> + pmu {
> + compatible = "arm,cortex-a7-pmu";
> + interrupts = <GIC_PPI 7 0xf04>;
GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH

Konrad
> + };
> +
> reserved-memory {
> #address-cells = <1>;
> #size-cells = <1>;

2023-05-20 10:31:00

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH 1/5] dt-bindings: sram: qcom,imem: Document MSM8226

On Sat, May 20, 2023 at 12:08:58AM +0300, Matti Lehtim?ki wrote:
> Add compatible for MSM8226 IMEM.
>
> Signed-off-by: Matti Lehtim?ki <[email protected]>

Acked-by: Conor Dooley <[email protected]>

Thanks,
Conor.


Attachments:
(No filename) (242.00 B)
signature.asc (235.00 B)
Download all attachments