[PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node

Dmitry Baryshkov posted 7 patches 3 months, 2 weeks ago
[PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Dmitry Baryshkov 3 months, 2 weeks ago
In order to reduce duplication, move common GPU memory configuration
from individual board files to sc8180x.dtsi.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 6 ------
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts         | 3 ++-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi               | 9 +++++++++
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
index 08d0784d0cbb899b021198bd85e26f1a93861713..625a155a584ae4ca14c6f373ef21b773ea7311cb 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
@@ -151,11 +151,6 @@ adsp_mem: adsp-region@90800000 {
 			no-map;
 		};
 
-		gpu_mem: gpu-region@98715000 {
-			reg = <0x0 0x98715000 0x0 0x2000>;
-			no-map;
-		};
-
 		cdsp_mem: cdsp-region@98900000 {
 			reg = <0x0 0x98900000 0x0 0x1400000>;
 			no-map;
@@ -357,7 +352,6 @@ &gpu {
 	status = "okay";
 
 	zap-shader {
-		memory-region = <&gpu_mem>;
 		firmware-name = "qcom/sc8180x/LENOVO/82AK/qcdxkmsuc8180.mbn";
 	};
 };
diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
@@ -14,6 +14,8 @@
 #include "sc8180x.dtsi"
 #include "sc8180x-pmics.dtsi"
 
+/delete-node/ &gpu_mem;
+
 / {
 	model = "Qualcomm SC8180x Primus";
 	compatible = "qcom,sc8180x-primus", "qcom,sc8180x";
@@ -444,7 +446,6 @@ &gpu {
 	status = "okay";
 
 	zap-shader {
-		memory-region = <&gpu_mem>;
 		firmware-name = "qcom/sc8180x/qcdxkmsuc8180.mbn";
 	};
 };
diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
index e3143a4a41c948cf4ddbf4b137a1323366566fdc..42ab76d52ae21c39d5855e20e11f9cb2319f3afa 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
@@ -646,6 +646,11 @@ reserved@89b00000 {
 			no-map;
 		};
 
+		gpu_mem: memory@98715000 {
+			reg = <0x0 0x98715000 0x0 0x2000>;
+			no-map;
+		};
+
 		reserved@9d400000 {
 			reg = <0x0 0x9d400000 0x0 0x1000000>;
 			no-map;
@@ -2274,6 +2279,10 @@ gpu: gpu@2c00000 {
 
 			status = "disabled";
 
+			zap-shader {
+				memory-region = <&gpu_mem>;
+			};
+
 			gpu_opp_table: opp-table {
 				compatible = "operating-points-v2";
 

-- 
2.47.3
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Konrad Dybcio 3 months, 1 week ago
On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> In order to reduce duplication, move common GPU memory configuration
> from individual board files to sc8180x.dtsi.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---

[...]

> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> @@ -14,6 +14,8 @@
>  #include "sc8180x.dtsi"
>  #include "sc8180x-pmics.dtsi"
>  
> +/delete-node/ &gpu_mem;
> +
>  / {
>  	model = "Qualcomm SC8180x Primus";
>  	compatible = "qcom,sc8180x-primus", "qcom,sc8180x";
> @@ -444,7 +446,6 @@ &gpu {
>  	status = "okay";
>  
>  	zap-shader {
> -		memory-region = <&gpu_mem>;

Hm?

Konrad
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Konrad Dybcio 3 months, 1 week ago
On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
>> In order to reduce duplication, move common GPU memory configuration
>> from individual board files to sc8180x.dtsi.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> ---
> 
> [...]
> 
>> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
>> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>> @@ -14,6 +14,8 @@
>>  #include "sc8180x.dtsi"
>>  #include "sc8180x-pmics.dtsi"
>>  
>> +/delete-node/ &gpu_mem;
>> +
>>  / {
>>  	model = "Qualcomm SC8180x Primus";
>>  	compatible = "qcom,sc8180x-primus", "qcom,sc8180x";
>> @@ -444,7 +446,6 @@ &gpu {
>>  	status = "okay";
>>  
>>  	zap-shader {
>> -		memory-region = <&gpu_mem>;
> 
> Hm?

I "hm"d at the wrong line.. why are we delete-node-ing gpu_mem?

Konrad
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Bjorn Andersson 3 months, 1 week ago
On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
> On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> > On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> >> In order to reduce duplication, move common GPU memory configuration
> >> from individual board files to sc8180x.dtsi.
> >>
> >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >> ---
> > 
> > [...]
> > 
> >> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> >> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >> @@ -14,6 +14,8 @@
> >>  #include "sc8180x.dtsi"
> >>  #include "sc8180x-pmics.dtsi"
> >>  
> >> +/delete-node/ &gpu_mem;

I agree with your hmm, seems this line should be dropped(?)

Dmitry, please confirm and I can fix it up as I'm applying the series.

Regards,
Bjorn

> >> +
> >>  / {
> >>  	model = "Qualcomm SC8180x Primus";
> >>  	compatible = "qcom,sc8180x-primus", "qcom,sc8180x";
> >> @@ -444,7 +446,6 @@ &gpu {
> >>  	status = "okay";
> >>  
> >>  	zap-shader {
> >> -		memory-region = <&gpu_mem>;
> > 
> > Hm?
> 
> I "hm"d at the wrong line.. why are we delete-node-ing gpu_mem?
> 
> Konrad
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Thu, Oct 30, 2025 at 12:28:31PM -0500, Bjorn Andersson wrote:
> On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
> > On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> > > On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> > >> In order to reduce duplication, move common GPU memory configuration
> > >> from individual board files to sc8180x.dtsi.
> > >>
> > >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > >> ---
> > > 
> > > [...]
> > > 
> > >> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> > >> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> @@ -14,6 +14,8 @@
> > >>  #include "sc8180x.dtsi"
> > >>  #include "sc8180x-pmics.dtsi"
> > >>  
> > >> +/delete-node/ &gpu_mem;
> 
> I agree with your hmm, seems this line should be dropped(?)
> 
> Dmitry, please confirm and I can fix it up as I'm applying the series.

Oh, and this line is necessary, because sc8180x-primus has its own
location for the gpu_mem.


-- 
With best wishes
Dmitry
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Bjorn Andersson 3 months, 1 week ago
On Thu, Oct 30, 2025 at 07:58:46PM +0200, Dmitry Baryshkov wrote:
> On Thu, Oct 30, 2025 at 12:28:31PM -0500, Bjorn Andersson wrote:
> > On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
> > > On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> > > > On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> > > >> In order to reduce duplication, move common GPU memory configuration
> > > >> from individual board files to sc8180x.dtsi.
> > > >>
> > > >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > > >> ---
> > > > 
> > > > [...]
> > > > 
> > > >> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > > >> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> > > >> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > > >> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > > >> @@ -14,6 +14,8 @@
> > > >>  #include "sc8180x.dtsi"
> > > >>  #include "sc8180x-pmics.dtsi"
> > > >>  
> > > >> +/delete-node/ &gpu_mem;
> > 
> > I agree with your hmm, seems this line should be dropped(?)
> > 
> > Dmitry, please confirm and I can fix it up as I'm applying the series.
> 
> Oh, and this line is necessary, because sc8180x-primus has its own
> location for the gpu_mem.
> 

Hmm, you're right, not sure why the memory map differs... But this looks
good then.

Regards,
Bjorn

> 
> -- 
> With best wishes
> Dmitry
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Konrad Dybcio 3 months, 1 week ago
On 10/30/25 7:45 PM, Bjorn Andersson wrote:
> On Thu, Oct 30, 2025 at 07:58:46PM +0200, Dmitry Baryshkov wrote:
>> On Thu, Oct 30, 2025 at 12:28:31PM -0500, Bjorn Andersson wrote:
>>> On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
>>>> On 10/30/25 11:58 AM, Konrad Dybcio wrote:
>>>>> On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
>>>>>> In order to reduce duplication, move common GPU memory configuration
>>>>>> from individual board files to sc8180x.dtsi.
>>>>>>
>>>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>>>>> ---
>>>>>
>>>>> [...]
>>>>>
>>>>>> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>>>>>> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
>>>>>> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>>>>>> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
>>>>>> @@ -14,6 +14,8 @@
>>>>>>  #include "sc8180x.dtsi"
>>>>>>  #include "sc8180x-pmics.dtsi"
>>>>>>  
>>>>>> +/delete-node/ &gpu_mem;
>>>
>>> I agree with your hmm, seems this line should be dropped(?)
>>>
>>> Dmitry, please confirm and I can fix it up as I'm applying the series.
>>
>> Oh, and this line is necessary, because sc8180x-primus has its own
>> location for the gpu_mem.
>>
> 
> Hmm, you're right, not sure why the memory map differs... But this looks
> good then.

The latest memory map for 8180 says:

GPU micro-code @ 0x98715000, 0x2000-long
(matching the Flex 5G)

Across all the revisions, Primus's range is either part of a
"reserved" region, or the CDSP's memory.

So it's either wrong or OEM-modified, with the latter being rather
an odd thing given it's a CRD..

Konrad
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Bjorn Andersson 3 months, 1 week ago
On Fri, Oct 31, 2025 at 10:30:17AM +0100, Konrad Dybcio wrote:
> On 10/30/25 7:45 PM, Bjorn Andersson wrote:
> > On Thu, Oct 30, 2025 at 07:58:46PM +0200, Dmitry Baryshkov wrote:
> >> On Thu, Oct 30, 2025 at 12:28:31PM -0500, Bjorn Andersson wrote:
> >>> On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
> >>>> On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> >>>>> On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> >>>>>> In order to reduce duplication, move common GPU memory configuration
> >>>>>> from individual board files to sc8180x.dtsi.
> >>>>>>
> >>>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >>>>>> ---
> >>>>>
> >>>>> [...]
> >>>>>
> >>>>>> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >>>>>> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> >>>>>> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >>>>>> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> >>>>>> @@ -14,6 +14,8 @@
> >>>>>>  #include "sc8180x.dtsi"
> >>>>>>  #include "sc8180x-pmics.dtsi"
> >>>>>>  
> >>>>>> +/delete-node/ &gpu_mem;
> >>>
> >>> I agree with your hmm, seems this line should be dropped(?)
> >>>
> >>> Dmitry, please confirm and I can fix it up as I'm applying the series.
> >>
> >> Oh, and this line is necessary, because sc8180x-primus has its own
> >> location for the gpu_mem.
> >>
> > 
> > Hmm, you're right, not sure why the memory map differs... But this looks
> > good then.
> 
> The latest memory map for 8180 says:
> 
> GPU micro-code @ 0x98715000, 0x2000-long
> (matching the Flex 5G)
> 
> Across all the revisions, Primus's range is either part of a
> "reserved" region, or the CDSP's memory.
> 
> So it's either wrong or OEM-modified, with the latter being rather
> an odd thing given it's a CRD..
> 

I have a faint memory of having issues placing that region, so I might
be that I just winged it on the primus...

Perhaps it doesn't need to be different, if so that's a separate change.

Regards,
Bjorn
Re: [PATCH 3/7] arm64: dts: qcom: sc8180x: create common zap-shader node
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Thu, 30 Oct 2025 at 19:25, Bjorn Andersson <andersson@kernel.org> wrote:
>
> On Thu, Oct 30, 2025 at 11:59:00AM +0100, Konrad Dybcio wrote:
> > On 10/30/25 11:58 AM, Konrad Dybcio wrote:
> > > On 10/28/25 10:00 PM, Dmitry Baryshkov wrote:
> > >> In order to reduce duplication, move common GPU memory configuration
> > >> from individual board files to sc8180x.dtsi.
> > >>
> > >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > >> ---
> > >
> > > [...]
> > >
> > >> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> index 93de9fe918ebdadf239832db647b84ac9d5a33f6..069953dcad378448800d45e14931efe1fe1a69fc 100644
> > >> --- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> +++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
> > >> @@ -14,6 +14,8 @@
> > >>  #include "sc8180x.dtsi"
> > >>  #include "sc8180x-pmics.dtsi"
> > >>
> > >> +/delete-node/ &gpu_mem;
>
> I agree with your hmm, seems this line should be dropped(?)
>
> Dmitry, please confirm and I can fix it up as I'm applying the series.
>
> Regards,
> Bjorn
>
> > >> +
> > >>  / {
> > >>    model = "Qualcomm SC8180x Primus";
> > >>    compatible = "qcom,sc8180x-primus", "qcom,sc8180x";
> > >> @@ -444,7 +446,6 @@ &gpu {
> > >>    status = "okay";
> > >>
> > >>    zap-shader {
> > >> -          memory-region = <&gpu_mem>;
> > >
> > > Hm?
> >
> > I "hm"d at the wrong line.. why are we delete-node-ing gpu_mem?

Because it's a part of the sc8180x.dtsi now. There is no need to have it here.



-- 
With best wishes
Dmitry