diff mbox series

[RFC/patch,2/2] arm64: boot: dts: qcom: surface duo: add minimal framebuffer

Message ID 20211217125757.1193256-3-balbi@kernel.org (mailing list archive)
State Changes Requested
Headers show
Series arm64: boot: dts: qcom: sm8150: enable framebuffer for Surface Duo | expand

Commit Message

Felipe Balbi Dec. 17, 2021, 12:57 p.m. UTC
From: Felipe Balbi <felipe.balbi@microsoft.com>

Add a minimal framebuffer device so we can use the display on the
Surface Duo device.

Signed-off-by: Felipe Balbi <felipe.balbi@microsoft.com>
---
 .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Konrad Dybcio Dec. 17, 2021, 5:32 p.m. UTC | #1
On 17.12.2021 13:57, Felipe Balbi wrote:
> From: Felipe Balbi <felipe.balbi@microsoft.com>
>
> Add a minimal framebuffer device so we can use the display on the
> Surface Duo device.
>
> Signed-off-by: Felipe Balbi <felipe.balbi@microsoft.com>
> ---
>  .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
> index a73317e1a824..c629ec115fec 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
> @@ -25,6 +25,17 @@ chosen {
>  		stdout-path = "serial0:115200n8";
>  	};
>  
> +	framebuffer0: framebuffer@9c000000 {
> +		compatible = "simple-framebuffer";
> +		reg = <0 0x9c000000 0 0x02400000>;

You can remove the leading 0 in the size cell.



> +		status = "okay";

This line is unnecessary, as it's enabled by default



> +
> +		height = <1800>;
> +		width = <1350>;
> +		stride = <(1350 * 4)>;
> +		format = "a8r8g8b8";
> +	};
> +
>  	vph_pwr: vph-pwr-regulator {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vph_pwr";
> @@ -472,6 +483,14 @@ &pon_resin {
>  	linux,code = <KEY_VOLUMEDOWN>;
>  };
>  
> +&reserved_memory {
> +	splash_region: splash_region@9c000000 {
> +		/* We expect the bootloader to fill in the size */

Would it be different than the framebuffer size?



> +		reg = <0x0 0x9c000000 0x0 0x0>;
> +		no-map;
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <126 4>;
>  


Konrad
Felipe Balbi Dec. 18, 2021, 7:15 a.m. UTC | #2
Hi,

Alexey Minnekhanov <alexeymin@postmarketos.org> writes:
> @@ -472,6 +483,14 @@ &pon_resin {
>  	linux,code = <KEY_VOLUMEDOWN>;
>  };
>  
> +&reserved_memory {
> +	splash_region: splash_region@9c000000 {
> +		/* We expect the bootloader to fill in the size */
> +		reg = <0x0 0x9c000000 0x0 0x0>;
>
> 0x2400000 should be here as size, maybe?

bootloader is filling that up, but sure I only used this to get the size
and base address from bootloader. I could just hardcode the values now
that I know them :-)

>
> 	 cont_splash_mem: memory@9c000000 {
> 		reg = <0x0 0x9c000000 0x0 0x2400000>;
> 		no-map;
> 	};
>
> FWIW, example above (with similar simple-framebuffer
> node) worked fine for my sm8150 based device.

Oh okay. So it's likely to be something specific to our bootloader.
Felipe Balbi Dec. 18, 2021, 7:19 a.m. UTC | #3
Hi,

Konrad Dybcio <konrad.dybcio@somainline.org> writes:

> On 17.12.2021 13:57, Felipe Balbi wrote:
>> From: Felipe Balbi <felipe.balbi@microsoft.com>
>>
>> Add a minimal framebuffer device so we can use the display on the
>> Surface Duo device.
>>
>> Signed-off-by: Felipe Balbi <felipe.balbi@microsoft.com>
>> ---
>>  .../dts/qcom/sm8150-microsoft-surface-duo.dts | 19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
>> index a73317e1a824..c629ec115fec 100644
>> --- a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
>> +++ b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
>> @@ -25,6 +25,17 @@ chosen {
>>  		stdout-path = "serial0:115200n8";
>>  	};
>>  
>> +	framebuffer0: framebuffer@9c000000 {
>> +		compatible = "simple-framebuffer";
>> +		reg = <0 0x9c000000 0 0x02400000>;
>
> You can remove the leading 0 in the size cell.

okay

>> +		status = "okay";
>
> This line is unnecessary, as it's enabled by default

understood

>> @@ -472,6 +483,14 @@ &pon_resin {
>>  	linux,code = <KEY_VOLUMEDOWN>;
>>  };
>>  
>> +&reserved_memory {
>> +	splash_region: splash_region@9c000000 {
>> +		/* We expect the bootloader to fill in the size */
>
> Would it be different than the framebuffer size?

honestly, I used this mainly to get the correct base address and size. I
had 0 everywhere and bootloader filled the entire thing for me. I can
just hardcode with the expected values anyway.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
index a73317e1a824..c629ec115fec 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
@@ -25,6 +25,17 @@  chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	framebuffer0: framebuffer@9c000000 {
+		compatible = "simple-framebuffer";
+		reg = <0 0x9c000000 0 0x02400000>;
+		status = "okay";
+
+		height = <1800>;
+		width = <1350>;
+		stride = <(1350 * 4)>;
+		format = "a8r8g8b8";
+	};
+
 	vph_pwr: vph-pwr-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vph_pwr";
@@ -472,6 +483,14 @@  &pon_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&reserved_memory {
+	splash_region: splash_region@9c000000 {
+		/* We expect the bootloader to fill in the size */
+		reg = <0x0 0x9c000000 0x0 0x0>;
+		no-map;
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <126 4>;