[PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous

Richard Weinberger posted 4 patches 2 months, 1 week ago
[PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Richard Weinberger 2 months, 1 week ago
These register maps contain registers where reads can cause an
imprecise async data abort.
Mark these register maps with has-inaccessible-regs to make sure
they cannot be accessed via debugfs and only by device drivers that
hopefully know exactly how and when access is allowed.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/arm/boot/dts/ti/omap/dra7-l4.dtsi | 4 ++++
 arch/arm/boot/dts/ti/omap/dra7.dtsi    | 1 +
 arch/arm/boot/dts/ti/omap/dra74x.dtsi  | 1 +
 3 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
index c9282f57ffa5e..bd037e199946e 100644
--- a/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra7-l4.dtsi
@@ -69,6 +69,7 @@ scm_conf: scm_conf@0 {
 					#address-cells = <1>;
 					#size-cells = <1>;
 					ranges = <0 0x0 0x1400>;
+					has-inaccessible-regs;
 
 					pbias_regulator: pbias_regulator@e00 {
 						compatible = "ti,pbias-dra7", "ti,pbias-omap";
@@ -110,11 +111,13 @@ scm_conf1: scm_conf@1c04 {
 					compatible = "syscon";
 					reg = <0x1c04 0x0020>;
 					#syscon-cells = <2>;
+					has-inaccessible-regs;
 				};
 
 				scm_conf_pcie: scm_conf@1c24 {
 					compatible = "syscon";
 					reg = <0x1c24 0x0024>;
+					has-inaccessible-regs;
 				};
 
 				sdma_xbar: dma-router@b78 {
@@ -4306,6 +4309,7 @@ target-module@c000 {			/* 0x4ae0c000, ap 17 50.0 */
 			scm_wkup: scm_conf@0 {
 				compatible = "syscon";
 				reg = <0 0x1000>;
+				has-inaccessible-regs;
 			};
 		};
 	};
diff --git a/arch/arm/boot/dts/ti/omap/dra7.dtsi b/arch/arm/boot/dts/ti/omap/dra7.dtsi
index 711ce4c31bb1f..1b1f31608d37e 100644
--- a/arch/arm/boot/dts/ti/omap/dra7.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra7.dtsi
@@ -359,6 +359,7 @@ bandgap: bandgap@4a0021e0 {
 		dsp1_system: dsp_system@40d00000 {
 			compatible = "syscon";
 			reg = <0x40d00000 0x100>;
+			has-inaccessible-regs;
 		};
 
 		dra7_iodelay_core: padconf@4844a000 {
diff --git a/arch/arm/boot/dts/ti/omap/dra74x.dtsi b/arch/arm/boot/dts/ti/omap/dra74x.dtsi
index cfb39dde49300..d814c31576797 100644
--- a/arch/arm/boot/dts/ti/omap/dra74x.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra74x.dtsi
@@ -47,6 +47,7 @@ ocp {
 		dsp2_system: dsp_system@41500000 {
 			compatible = "syscon";
 			reg = <0x41500000 0x100>;
+			has-inaccessible-regs;
 		};
 
 
-- 
2.51.0
Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Krzysztof Kozlowski 2 months, 1 week ago
On 29/11/2025 15:20, Richard Weinberger wrote:
> index 711ce4c31bb1f..1b1f31608d37e 100644
> --- a/arch/arm/boot/dts/ti/omap/dra7.dtsi
> +++ b/arch/arm/boot/dts/ti/omap/dra7.dtsi
> @@ -359,6 +359,7 @@ bandgap: bandgap@4a0021e0 {
>  		dsp1_system: dsp_system@40d00000 {
>  			compatible = "syscon";

Oh, no no, sorry, but buggy/incomplete/legacy DT is not an excuse for
new properties. You cannot have such compatible alone in the first place.

>  			reg = <0x40d00000 0x100>;
> +			has-inaccessible-regs;
>  		};




Best regards,
Krzysztof
Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Richard Weinberger 2 months, 1 week ago
----- Ursprüngliche Mail -----
> Von: "Krzysztof Kozlowski" <krzk@kernel.org>
> An: "richard" <richard@nod.at>, "linux-kernel" <linux-kernel@vger.kernel.org>
> CC: "linux-omap" <linux-omap@vger.kernel.org>, "devicetree" <devicetree@vger.kernel.org>, "Arnd Bergmann"
> <arnd@arndb.de>, "Lee Jones" <lee@kernel.org>, "dakr" <dakr@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, "Greg
> Kroah-Hartman" <gregkh@linuxfoundation.org>, "Mark Brown" <broonie@kernel.org>, "tony" <tony@atomide.com>, "rogerq"
> <rogerq@kernel.org>, "khilman" <khilman@baylibre.com>, "Andreas Kemnade" <andreas@kemnade.info>, "aaro koskinen"
> <aaro.koskinen@iki.fi>, "Conor Dooley" <conor+dt@kernel.org>, "Krzysztof Kozlowski" <krzk+dt@kernel.org>, "robh"
> <robh@kernel.org>
> Gesendet: Samstag, 29. November 2025 16:26:19
> Betreff: Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous

> On 29/11/2025 15:20, Richard Weinberger wrote:
>> index 711ce4c31bb1f..1b1f31608d37e 100644
>> --- a/arch/arm/boot/dts/ti/omap/dra7.dtsi
>> +++ b/arch/arm/boot/dts/ti/omap/dra7.dtsi
>> @@ -359,6 +359,7 @@ bandgap: bandgap@4a0021e0 {
>>  		dsp1_system: dsp_system@40d00000 {
>>  			compatible = "syscon";
> 
> Oh, no no, sorry, but buggy/incomplete/legacy DT is not an excuse for
> new properties. You cannot have such compatible alone in the first place.

Okay, I didn't know that the OMAP DT is in that bad shape.
Is somebody working on a solution?

Thanks,
//richard
Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Andreas Kemnade 2 months, 1 week ago
On Sat, 29 Nov 2025 16:35:31 +0100 (CET)
Richard Weinberger <richard@nod.at> wrote:

> ----- Ursprüngliche Mail -----
> > Von: "Krzysztof Kozlowski" <krzk@kernel.org>
> > An: "richard" <richard@nod.at>, "linux-kernel" <linux-kernel@vger.kernel.org>
> > CC: "linux-omap" <linux-omap@vger.kernel.org>, "devicetree" <devicetree@vger.kernel.org>, "Arnd Bergmann"
> > <arnd@arndb.de>, "Lee Jones" <lee@kernel.org>, "dakr" <dakr@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, "Greg
> > Kroah-Hartman" <gregkh@linuxfoundation.org>, "Mark Brown" <broonie@kernel.org>, "tony" <tony@atomide.com>, "rogerq"
> > <rogerq@kernel.org>, "khilman" <khilman@baylibre.com>, "Andreas Kemnade" <andreas@kemnade.info>, "aaro koskinen"
> > <aaro.koskinen@iki.fi>, "Conor Dooley" <conor+dt@kernel.org>, "Krzysztof Kozlowski" <krzk+dt@kernel.org>, "robh"
> > <robh@kernel.org>
> > Gesendet: Samstag, 29. November 2025 16:26:19
> > Betreff: Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous  
> 
> > On 29/11/2025 15:20, Richard Weinberger wrote:  
> >> index 711ce4c31bb1f..1b1f31608d37e 100644
> >> --- a/arch/arm/boot/dts/ti/omap/dra7.dtsi
> >> +++ b/arch/arm/boot/dts/ti/omap/dra7.dtsi
> >> @@ -359,6 +359,7 @@ bandgap: bandgap@4a0021e0 {
> >>  		dsp1_system: dsp_system@40d00000 {
> >>  			compatible = "syscon";  
> > 
> > Oh, no no, sorry, but buggy/incomplete/legacy DT is not an excuse for
> > new properties. You cannot have such compatible alone in the first place.  
> 
> Okay, I didn't know that the OMAP DT is in that bad shape.
> Is somebody working on a solution?
> 
well, it is an arduous work, piece by piece work. But things are getting better
slowly. I convert bindings from time to time, mostly the ones
needed by omap3-5 parts, not the active am3/5 parts.

compare
https://gitlab.com/robherring/linux-dt/-/jobs/5620809910#L5618

to the newer
https://gitlab.com/robherring/linux-dt/-/jobs/12112550529#L5156


Regards,
Andreas
Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Krzysztof Kozlowski 2 months, 1 week ago
On 29/11/2025 16:35, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Krzysztof Kozlowski" <krzk@kernel.org>
>> An: "richard" <richard@nod.at>, "linux-kernel" <linux-kernel@vger.kernel.org>
>> CC: "linux-omap" <linux-omap@vger.kernel.org>, "devicetree" <devicetree@vger.kernel.org>, "Arnd Bergmann"
>> <arnd@arndb.de>, "Lee Jones" <lee@kernel.org>, "dakr" <dakr@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, "Greg
>> Kroah-Hartman" <gregkh@linuxfoundation.org>, "Mark Brown" <broonie@kernel.org>, "tony" <tony@atomide.com>, "rogerq"
>> <rogerq@kernel.org>, "khilman" <khilman@baylibre.com>, "Andreas Kemnade" <andreas@kemnade.info>, "aaro koskinen"
>> <aaro.koskinen@iki.fi>, "Conor Dooley" <conor+dt@kernel.org>, "Krzysztof Kozlowski" <krzk+dt@kernel.org>, "robh"
>> <robh@kernel.org>
>> Gesendet: Samstag, 29. November 2025 16:26:19
>> Betreff: Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
> 
>> On 29/11/2025 15:20, Richard Weinberger wrote:
>>> index 711ce4c31bb1f..1b1f31608d37e 100644
>>> --- a/arch/arm/boot/dts/ti/omap/dra7.dtsi
>>> +++ b/arch/arm/boot/dts/ti/omap/dra7.dtsi
>>> @@ -359,6 +359,7 @@ bandgap: bandgap@4a0021e0 {
>>>  		dsp1_system: dsp_system@40d00000 {
>>>  			compatible = "syscon";
>>
>> Oh, no no, sorry, but buggy/incomplete/legacy DT is not an excuse for
>> new properties. You cannot have such compatible alone in the first place.
> 
> Okay, I didn't know that the OMAP DT is in that bad shape.

Heh, let me give you a piece of a spoiler of my OSS Japan talk in a
week: TI (entire TI, not individual sub-platforms) for arm32 is 0%
compliant, meaning EVERY board has issues, and TI has THE HIGHEST total
number of warnings of all active mainline arm32 platforms.

TI ARM32 status is absolutely terrible... TI ARM64 is on quite different
side. :)

More of hall-of-shame on 9th of December...

Best regards,
Krzysztof
Re: [PATCH 4/4] arm: dts: omap: Mark various register maps as dangerous
Posted by Richard Weinberger 2 months, 1 week ago
----- Ursprüngliche Mail -----
> Von: "Krzysztof Kozlowski" <krzk@kernel.org>
>> Okay, I didn't know that the OMAP DT is in that bad shape.
> 
> Heh, let me give you a piece of a spoiler of my OSS Japan talk in a
> week: TI (entire TI, not individual sub-platforms) for arm32 is 0%
> compliant, meaning EVERY board has issues, and TI has THE HIGHEST total
> number of warnings of all active mainline arm32 platforms.

Oh dear. :-S
 
> TI ARM32 status is absolutely terrible... TI ARM64 is on quite different
> side. :)
> 
> More of hall-of-shame on 9th of December...

Let's hope this helps to motivate some TI guys.
I can help with TI platforms I have access to but I don't consider
myself an TI SoC expert to do massive refactoring of their device trees.

Thanks,
//richard