diff mbox series

arm64: dts: pinephone: Add pstore support for PinePhone A64

Message ID 20230724213457.24593-1-andrej.skvortzov@gmail.com
State Superseded
Headers show
Series arm64: dts: pinephone: Add pstore support for PinePhone A64 | expand

Commit Message

Andrey Skvortsov July 24, 2023, 9:34 p.m. UTC
This patch reserves some memory in the DTS and sets up a
pstore device tree node to enable pstore support.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>

Gbp-Pq: Topic pinephone
Gbp-Pq: Name 0161-arm64-dts-pinephone-Add-pstore-support-for-PinePhone.patch
---
 .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Andre Przywara July 27, 2023, 2:57 p.m. UTC | #1
Hi,

On 24/07/2023 22:34, Andrey Skvortsov wrote:
> This patch reserves some memory in the DTS and sets up a
> pstore device tree node to enable pstore support.
> 
> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
> 
> Gbp-Pq: Topic pinephone
> Gbp-Pq: Name 0161-arm64-dts-pinephone-Add-pstore-support-for-PinePhone.patch
> ---
>   .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> index 87847116ab6d..84f9410b0b70 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> @@ -19,6 +19,22 @@ aliases {
>   		serial0 = &uart0;
>   	};
>   
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		pstore_mem: ramoops@61000000 {
> +			compatible = "ramoops";
> +			reg = <0x61000000 0x100000>;

So what's the significance of this address? That's 528MB into DRAM, so 
somewhat in the middle of it, fragmenting the physical address space.
And is there any other firmware component that needs to know about this 
address?

Cheers,
Andre


> +			record-size = <0x20000>;
> +			console-size = <0x20000>;
> +			ftrace-size = <0x20000>;
> +			pmsg-size = <0x20000>;
> +			ecc-size = <16>;
> +		};
> +	};
> +
>   	backlight: backlight {
>   		compatible = "pwm-backlight";
>   		pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
Andrey Skvortsov July 28, 2023, 8:25 p.m. UTC | #2
On 23-07-27 15:57, Andre Przywara wrote:
> Hi,
> 
> On 24/07/2023 22:34, Andrey Skvortsov wrote:
> > This patch reserves some memory in the DTS and sets up a
> > pstore device tree node to enable pstore support.
> > 
> > Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
> > 
> > Gbp-Pq: Topic pinephone
> > Gbp-Pq: Name 0161-arm64-dts-pinephone-Add-pstore-support-for-PinePhone.patch
> > ---
> >   .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 16 ++++++++++++++++
> >   1 file changed, 16 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> > index 87847116ab6d..84f9410b0b70 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> > @@ -19,6 +19,22 @@ aliases {
> >   		serial0 = &uart0;
> >   	};
> > +	reserved-memory {
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +		ranges;
> > +
> > +		pstore_mem: ramoops@61000000 {
> > +			compatible = "ramoops";
> > +			reg = <0x61000000 0x100000>;
> 
> So what's the significance of this address? That's 528MB into DRAM, so
> somewhat in the middle of it, fragmenting the physical address space.
> And is there any other firmware component that needs to know about this
> address?

Hi, Andre,

there is nothing special about this address.
Range from 0x40000000 - 0x50000000 is heavily used by u-boot for
internal use and to load kernel, fdt, fdto, scripts, pxefile and ramdisk
later in the boot process.
Ramdisk start address is 0x4FF00000, Mobian initramfs for PinePhone
for kernel with some hacking features and debug info enabled can
take more than 100Mb and final address will be around 0x58000000.
So I've picked address that will most likely not overlap with
that. Probably it can be moved below 512Mb. If you have address
suggestion, I'd happy to check it.
Pavel Machek Aug. 21, 2023, 4:08 p.m. UTC | #3
Hi!

> This patch reserves some memory in the DTS and sets up a
> pstore device tree node to enable pstore support.
> 
> Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
> 
> Gbp-Pq: Topic pinephone
> Gbp-Pq: Name 0161-arm64-dts-pinephone-Add-pstore-support-for-PinePhone.patch
> ---
>  .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> index 87847116ab6d..84f9410b0b70 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
> @@ -19,6 +19,22 @@ aliases {
>  		serial0 = &uart0;
>  	};
>  
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		pstore_mem: ramoops@61000000 {
> +			compatible = "ramoops";
> +			reg = <0x61000000 0x100000>;
> +			record-size = <0x20000>;
> +			console-size = <0x20000>;
> +			ftrace-size = <0x20000>;
> +			pmsg-size = <0x20000>;
> +			ecc-size = <16>;
> +		};
> +	};

dts is supposed to be for hardware description, but this is really policy decision.

Should we have something like "any dram is suitable for pstore"....?

Best regards,
										Pavel
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 87847116ab6d..84f9410b0b70 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -19,6 +19,22 @@  aliases {
 		serial0 = &uart0;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		pstore_mem: ramoops@61000000 {
+			compatible = "ramoops";
+			reg = <0x61000000 0x100000>;
+			record-size = <0x20000>;
+			console-size = <0x20000>;
+			ftrace-size = <0x20000>;
+			pmsg-size = <0x20000>;
+			ecc-size = <16>;
+		};
+	};
+
 	backlight: backlight {
 		compatible = "pwm-backlight";
 		pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;