* [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-24 16:25 [PATCH v3 0/5] imx8mp: add support for the IMX AIPSTZ bridge Laurentiu Mihalcea
@ 2025-03-24 16:25 ` Laurentiu Mihalcea
2025-03-25 3:23 ` Rob Herring
2025-03-24 16:25 ` [PATCH v3 2/5] dt-bindings: dsp: fsl,dsp: document 'access-controllers' property Laurentiu Mihalcea
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-03-24 16:25 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marco Felsch, Marc Kleine-Budde
Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add documentation for IMX AIPSTZ bridge.
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
.../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
new file mode 100644
index 000000000000..c0427dfcdaca
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
@@ -0,0 +1,107 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Secure AHB to IP Slave bus (AIPSTZ) bridge
+
+description:
+ The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
+ issuing transactions to IP Slave peripherals. Additionally, this module
+ offers access control configurations meant to restrict which peripherals
+ a master can access.
+
+maintainers:
+ - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
+
+properties:
+ compatible:
+ const: fsl,imx8mp-aipstz
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: bus
+ - const: ac
+
+ power-domains:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 1
+
+ "#access-controller-cells":
+ const: 0
+
+ ranges: true
+
+# borrowed from simple-bus.yaml, no additional requirements for children
+patternProperties:
+ "@(0|[1-9a-f][0-9a-f]*)$":
+ type: object
+ additionalProperties: true
+ properties:
+ reg:
+ items:
+ minItems: 2
+ maxItems: 4
+ minItems: 1
+ maxItems: 1024
+ ranges:
+ oneOf:
+ - items:
+ minItems: 3
+ maxItems: 7
+ minItems: 1
+ maxItems: 1024
+ - $ref: /schemas/types.yaml#/definitions/flag
+ anyOf:
+ - required:
+ - reg
+ - required:
+ - ranges
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - power-domains
+ - "#address-cells"
+ - "#size-cells"
+ - "#access-controller-cells"
+ - ranges
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/imx8mp-clock.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ bus@30c00000 {
+ compatible = "fsl,imx8mp-aipstz";
+ reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
+ reg-names = "bus", "ac";
+ power-domains = <&pgc_audio>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #access-controller-cells = <0>;
+ ranges;
+
+ dma-controller@30e00000 {
+ compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
+ reg = <0x30e00000 0x10000>;
+ #dma-cells = <3>;
+ clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
+ <&clk IMX8MP_CLK_AUDIO_ROOT>;
+ clock-names = "ipg", "ahb";
+ interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+ fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-24 16:25 ` [PATCH v3 1/5] dt-bindings: bus: add documentation " Laurentiu Mihalcea
@ 2025-03-25 3:23 ` Rob Herring
2025-03-26 10:25 ` Marco Felsch
2025-03-28 12:34 ` Mihalcea Laurentiu
0 siblings, 2 replies; 13+ messages in thread
From: Rob Herring @ 2025-03-25 3:23 UTC (permalink / raw)
To: Laurentiu Mihalcea
Cc: Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Fabio Estevam, Daniel Baluta, Shengjiu Wang, Frank Li,
Marco Felsch, Marc Kleine-Budde, Pengutronix Kernel Team,
devicetree, imx, linux-arm-kernel, linux-kernel
On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Add documentation for IMX AIPSTZ bridge.
>
> Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
> .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
> 1 file changed, 107 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>
> diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> new file mode 100644
> index 000000000000..c0427dfcdaca
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> @@ -0,0 +1,107 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
> +
> +description:
> + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
> + issuing transactions to IP Slave peripherals. Additionally, this module
> + offers access control configurations meant to restrict which peripherals
> + a master can access.
Wrap at 80 chars.
> +
> +maintainers:
> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> +
> +properties:
> + compatible:
> + const: fsl,imx8mp-aipstz
> +
> + reg:
> + maxItems: 2
> +
> + reg-names:
> + items:
> + - const: bus
> + - const: ac
> +
> + power-domains:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 1
> +
> + "#access-controller-cells":
> + const: 0
With 0 cells, how do you identify which device it is?
> +
> + ranges: true
> +
> +# borrowed from simple-bus.yaml, no additional requirements for children
> +patternProperties:
> + "@(0|[1-9a-f][0-9a-f]*)$":
> + type: object
> + additionalProperties: true
> + properties:
> + reg:
> + items:
> + minItems: 2
> + maxItems: 4
> + minItems: 1
> + maxItems: 1024
> + ranges:
> + oneOf:
> + - items:
> + minItems: 3
> + maxItems: 7
> + minItems: 1
> + maxItems: 1024
> + - $ref: /schemas/types.yaml#/definitions/flag
> + anyOf:
> + - required:
> + - reg
> + - required:
> + - ranges
> +
> +required:
> + - compatible
> + - reg
> + - reg-names
> + - power-domains
> + - "#address-cells"
> + - "#size-cells"
> + - "#access-controller-cells"
> + - ranges
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/imx8mp-clock.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + bus@30c00000 {
> + compatible = "fsl,imx8mp-aipstz";
> + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
It doesn't look like you have any registers in the 1st entry, but they
are child devices? Then you should use ranges and drop it here:
ranges = <0x0 0x30c00000 0x400000>;
> + reg-names = "bus", "ac";
> + power-domains = <&pgc_audio>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + #access-controller-cells = <0>;
> + ranges;
> +
> + dma-controller@30e00000 {
> + compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
> + reg = <0x30e00000 0x10000>;
> + #dma-cells = <3>;
> + clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
> + <&clk IMX8MP_CLK_AUDIO_ROOT>;
> + clock-names = "ipg", "ahb";
> + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
> + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
No 'access-controllers' here?
> + };
> + };
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-25 3:23 ` Rob Herring
@ 2025-03-26 10:25 ` Marco Felsch
2025-03-26 12:25 ` Marco Felsch
2025-03-28 12:34 ` Mihalcea Laurentiu
1 sibling, 1 reply; 13+ messages in thread
From: Marco Felsch @ 2025-03-26 10:25 UTC (permalink / raw)
To: Rob Herring
Cc: Laurentiu Mihalcea, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marc Kleine-Budde, Pengutronix Kernel Team, devicetree,
imx, linux-arm-kernel, linux-kernel
Hi Laurentiu,
On 25-03-24, Rob Herring wrote:
> On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
> > From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >
> > Add documentation for IMX AIPSTZ bridge.
> >
> > Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
> > Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> > Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > ---
> > .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
> > 1 file changed, 107 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> > new file mode 100644
> > index 000000000000..c0427dfcdaca
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> > @@ -0,0 +1,107 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
> > +
> > +description:
> > + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
> > + issuing transactions to IP Slave peripherals. Additionally, this module
> > + offers access control configurations meant to restrict which peripherals
> > + a master can access.
>
> Wrap at 80 chars.
>
> > +
> > +maintainers:
> > + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > +
> > +properties:
> > + compatible:
> > + const: fsl,imx8mp-aipstz
> > +
> > + reg:
> > + maxItems: 2
> > +
> > + reg-names:
> > + items:
> > + - const: bus
> > + - const: ac
> > +
> > + power-domains:
> > + maxItems: 1
> > +
> > + "#address-cells":
> > + const: 1
> > +
> > + "#size-cells":
> > + const: 1
> > +
> > + "#access-controller-cells":
> > + const: 0
>
> With 0 cells, how do you identify which device it is?
>
> > +
> > + ranges: true
> > +
> > +# borrowed from simple-bus.yaml, no additional requirements for children
> > +patternProperties:
> > + "@(0|[1-9a-f][0-9a-f]*)$":
> > + type: object
> > + additionalProperties: true
> > + properties:
> > + reg:
> > + items:
> > + minItems: 2
> > + maxItems: 4
> > + minItems: 1
> > + maxItems: 1024
> > + ranges:
> > + oneOf:
> > + - items:
> > + minItems: 3
> > + maxItems: 7
> > + minItems: 1
> > + maxItems: 1024
> > + - $ref: /schemas/types.yaml#/definitions/flag
> > + anyOf:
> > + - required:
> > + - reg
> > + - required:
> > + - ranges
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - reg-names
> > + - power-domains
> > + - "#address-cells"
> > + - "#size-cells"
> > + - "#access-controller-cells"
> > + - ranges
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/imx8mp-clock.h>
> > + #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > + bus@30c00000 {
> > + compatible = "fsl,imx8mp-aipstz";
> > + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
>
> It doesn't look like you have any registers in the 1st entry, but they
> are child devices? Then you should use ranges and drop it here:
>
> ranges = <0x0 0x30c00000 0x400000>;
>
>
> > + reg-names = "bus", "ac";
Thanks for picking up my suggestion :) IMHO it does look more logical
now. I wasn't aware of the 'ranges' property else I would have suggested
you to use this property instead of having two regs, sorry. Once you
changed it to ranges we can drop the 'reg-names' as well since you only
need to supply the 'ac' register space.
Regards,
Marco
> > + power-domains = <&pgc_audio>;
> > + #address-cells = <1>;
> > + #size-cells = <1>;
> > + #access-controller-cells = <0>;
> > + ranges;
> > +
> > + dma-controller@30e00000 {
> > + compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
> > + reg = <0x30e00000 0x10000>;
> > + #dma-cells = <3>;
> > + clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
> > + <&clk IMX8MP_CLK_AUDIO_ROOT>;
> > + clock-names = "ipg", "ahb";
> > + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
> > + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
>
> No 'access-controllers' here?
>
> > + };
> > + };
> > --
> > 2.34.1
> >
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-26 10:25 ` Marco Felsch
@ 2025-03-26 12:25 ` Marco Felsch
0 siblings, 0 replies; 13+ messages in thread
From: Marco Felsch @ 2025-03-26 12:25 UTC (permalink / raw)
To: Rob Herring
Cc: Daniel Baluta, devicetree, Conor Dooley, imx, Shawn Guo,
Sascha Hauer, Frank Li, linux-kernel, Laurentiu Mihalcea,
Marc Kleine-Budde, Pengutronix Kernel Team, Krzysztof Kozlowski,
Fabio Estevam, Shengjiu Wang, linux-arm-kernel
On 25-03-26, Marco Felsch wrote:
> Hi Laurentiu,
>
> On 25-03-24, Rob Herring wrote:
> > On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
> > > From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > >
> > > Add documentation for IMX AIPSTZ bridge.
> > >
> > > Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
> > > Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> > > Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > > ---
> > > .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
> > > 1 file changed, 107 insertions(+)
> > > create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> > > new file mode 100644
> > > index 000000000000..c0427dfcdaca
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> > > @@ -0,0 +1,107 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
> > > +
> > > +description:
> > > + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
> > > + issuing transactions to IP Slave peripherals. Additionally, this module
> > > + offers access control configurations meant to restrict which peripherals
> > > + a master can access.
> >
> > Wrap at 80 chars.
> >
> > > +
> > > +maintainers:
> > > + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > > +
> > > +properties:
> > > + compatible:
> > > + const: fsl,imx8mp-aipstz
> > > +
> > > + reg:
> > > + maxItems: 2
> > > +
> > > + reg-names:
> > > + items:
> > > + - const: bus
> > > + - const: ac
> > > +
> > > + power-domains:
> > > + maxItems: 1
> > > +
> > > + "#address-cells":
> > > + const: 1
> > > +
> > > + "#size-cells":
> > > + const: 1
> > > +
> > > + "#access-controller-cells":
> > > + const: 0
> >
> > With 0 cells, how do you identify which device it is?
> >
> > > +
> > > + ranges: true
> > > +
> > > +# borrowed from simple-bus.yaml, no additional requirements for children
> > > +patternProperties:
> > > + "@(0|[1-9a-f][0-9a-f]*)$":
> > > + type: object
> > > + additionalProperties: true
> > > + properties:
> > > + reg:
> > > + items:
> > > + minItems: 2
> > > + maxItems: 4
> > > + minItems: 1
> > > + maxItems: 1024
> > > + ranges:
> > > + oneOf:
> > > + - items:
> > > + minItems: 3
> > > + maxItems: 7
> > > + minItems: 1
> > > + maxItems: 1024
> > > + - $ref: /schemas/types.yaml#/definitions/flag
> > > + anyOf:
> > > + - required:
> > > + - reg
> > > + - required:
> > > + - ranges
> > > +
> > > +required:
> > > + - compatible
> > > + - reg
> > > + - reg-names
> > > + - power-domains
> > > + - "#address-cells"
> > > + - "#size-cells"
> > > + - "#access-controller-cells"
> > > + - ranges
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > + - |
> > > + #include <dt-bindings/clock/imx8mp-clock.h>
> > > + #include <dt-bindings/interrupt-controller/arm-gic.h>
> > > +
> > > + bus@30c00000 {
> > > + compatible = "fsl,imx8mp-aipstz";
> > > + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
> >
> > It doesn't look like you have any registers in the 1st entry, but they
> > are child devices? Then you should use ranges and drop it here:
> >
> > ranges = <0x0 0x30c00000 0x400000>;
> >
> >
> > > + reg-names = "bus", "ac";
>
> Thanks for picking up my suggestion :) IMHO it does look more logical
> now. I wasn't aware of the 'ranges' property else I would have suggested
> you to use this property instead of having two regs, sorry. Once you
> changed it to ranges we can drop the 'reg-names' as well since you only
> need to supply the 'ac' register space.
>
> Regards,
> Marco
>
> > > + power-domains = <&pgc_audio>;
> > > + #address-cells = <1>;
> > > + #size-cells = <1>;
> > > + #access-controller-cells = <0>;
> > > + ranges;
I didn't noticed that we already do have the ranges 1:1 mapping, sorry!
@Rob
A "ranges = <0x0 0x30c00000 0x400000>;" would make writing/syncing the
.dtsi harder since NXP decided to use use global addresses in their
technical reference manual.
@Laurentiu
Could you please add a "ranges = <0x30c00000 0x30c00000 0x400000>;" for
the bus? Of course it is still a 1:1 mapping but limits the bus size
which can be helpful if someone add a device on the wrong bus.
Sorry for my previous suggestion on your V2 which seems more reasonable
now.
Regards,
Marco
> > > + dma-controller@30e00000 {
> > > + compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
> > > + reg = <0x30e00000 0x10000>;
> > > + #dma-cells = <3>;
> > > + clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
> > > + <&clk IMX8MP_CLK_AUDIO_ROOT>;
> > > + clock-names = "ipg", "ahb";
> > > + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
> > > + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
> >
> > No 'access-controllers' here?
> >
> > > + };
> > > + };
> > > --
> > > 2.34.1
> > >
> >
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-25 3:23 ` Rob Herring
2025-03-26 10:25 ` Marco Felsch
@ 2025-03-28 12:34 ` Mihalcea Laurentiu
2025-03-31 6:41 ` Marco Felsch
2025-03-31 14:15 ` Rob Herring
1 sibling, 2 replies; 13+ messages in thread
From: Mihalcea Laurentiu @ 2025-03-28 12:34 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Fabio Estevam, Daniel Baluta, Shengjiu Wang, Frank Li,
Marco Felsch, Marc Kleine-Budde, Pengutronix Kernel Team,
devicetree, imx, linux-arm-kernel, linux-kernel
On 25.03.2025 05:23, Rob Herring wrote:
> On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
>> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>
>> Add documentation for IMX AIPSTZ bridge.
>>
>> Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
>> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
>> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>> ---
>> .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
>> 1 file changed, 107 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>> new file mode 100644
>> index 000000000000..c0427dfcdaca
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>> @@ -0,0 +1,107 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
>> +
>> +description:
>> + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
>> + issuing transactions to IP Slave peripherals. Additionally, this module
>> + offers access control configurations meant to restrict which peripherals
>> + a master can access.
> Wrap at 80 chars.
fix in v4, thx
>
>> +
>> +maintainers:
>> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>> +
>> +properties:
>> + compatible:
>> + const: fsl,imx8mp-aipstz
>> +
>> + reg:
>> + maxItems: 2
>> +
>> + reg-names:
>> + items:
>> + - const: bus
>> + - const: ac
>> +
>> + power-domains:
>> + maxItems: 1
>> +
>> + "#address-cells":
>> + const: 1
>> +
>> + "#size-cells":
>> + const: 1
>> +
>> + "#access-controller-cells":
>> + const: 0
> With 0 cells, how do you identify which device it is?
we don't atm. We're relying on the default configuration.
we don't have any APIs for AC configuration so I left the
cell number to 0 thinking that the cell number might depend
on the API.
if need be, I can set it to the value I was initially thinking of in v4.
>
>> +
>> + ranges: true
>> +
>> +# borrowed from simple-bus.yaml, no additional requirements for children
>> +patternProperties:
>> + "@(0|[1-9a-f][0-9a-f]*)$":
>> + type: object
>> + additionalProperties: true
>> + properties:
>> + reg:
>> + items:
>> + minItems: 2
>> + maxItems: 4
>> + minItems: 1
>> + maxItems: 1024
>> + ranges:
>> + oneOf:
>> + - items:
>> + minItems: 3
>> + maxItems: 7
>> + minItems: 1
>> + maxItems: 1024
>> + - $ref: /schemas/types.yaml#/definitions/flag
>> + anyOf:
>> + - required:
>> + - reg
>> + - required:
>> + - ranges
>> +
>> +required:
>> + - compatible
>> + - reg
>> + - reg-names
>> + - power-domains
>> + - "#address-cells"
>> + - "#size-cells"
>> + - "#access-controller-cells"
>> + - ranges
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/clock/imx8mp-clock.h>
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> +
>> + bus@30c00000 {
>> + compatible = "fsl,imx8mp-aipstz";
>> + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
> It doesn't look like you have any registers in the 1st entry, but they
> are child devices? Then you should use ranges and drop it here:
>
> ranges = <0x0 0x30c00000 0x400000>;
I guess this would mean switching from global addresses (current way) to
bus-relative addresses for the child devices. This wasn't my intent.
I wonder if we could just switch to V2 in which we just use the bridge's AC
configuration space and an empty 'ranges':
aips5: bus@30df0000 {
compatible = "fsl,imx8mp-aipstz";
reg = <0x30df0000 0x10000>;
/* some more properties here */
ranges;
};
or as Marco just suggested use
ranges = <0x30c00000 0x30c00000 0x400000>;
instead of an empty 'ranges' to restrict the bus size.
Personally, I'm fine with both approaches but what's your opinion on this?
>
>
>> + reg-names = "bus", "ac";
>> + power-domains = <&pgc_audio>;
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + #access-controller-cells = <0>;
>> + ranges;
>> +
>> + dma-controller@30e00000 {
>> + compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
>> + reg = <0x30e00000 0x10000>;
>> + #dma-cells = <3>;
>> + clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
>> + <&clk IMX8MP_CLK_AUDIO_ROOT>;
>> + clock-names = "ipg", "ahb";
>> + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
>> + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
> No 'access-controllers' here?
no need for that unless the child wants to request a specific AC
configuration for itself.
>
>> + };
>> + };
>> --
>> 2.34.1
>>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-28 12:34 ` Mihalcea Laurentiu
@ 2025-03-31 6:41 ` Marco Felsch
2025-03-31 11:57 ` Mihalcea Laurentiu
2025-03-31 14:15 ` Rob Herring
1 sibling, 1 reply; 13+ messages in thread
From: Marco Felsch @ 2025-03-31 6:41 UTC (permalink / raw)
To: Mihalcea Laurentiu
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marc Kleine-Budde, Pengutronix Kernel Team, devicetree,
imx, linux-arm-kernel, linux-kernel
On 25-03-28, Mihalcea Laurentiu wrote:
>
> On 25.03.2025 05:23, Rob Herring wrote:
> > On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
> >> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >>
> >> Add documentation for IMX AIPSTZ bridge.
> >>
> >> Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
> >> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> >> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >> ---
> >> .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
> >> 1 file changed, 107 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >> new file mode 100644
> >> index 000000000000..c0427dfcdaca
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >> @@ -0,0 +1,107 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
> >> +
> >> +description:
> >> + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
> >> + issuing transactions to IP Slave peripherals. Additionally, this module
> >> + offers access control configurations meant to restrict which peripherals
> >> + a master can access.
> > Wrap at 80 chars.
>
>
> fix in v4, thx
>
> >> +maintainers:
> >> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >> +
> >> +properties:
> >> + compatible:
> >> + const: fsl,imx8mp-aipstz
> >> +
> >> + reg:
> >> + maxItems: 2
> >> +
> >> + reg-names:
> >> + items:
> >> + - const: bus
> >> + - const: ac
> >> +
> >> + power-domains:
> >> + maxItems: 1
> >> +
> >> + "#address-cells":
> >> + const: 1
> >> +
> >> + "#size-cells":
> >> + const: 1
> >> +
> >> + "#access-controller-cells":
> >> + const: 0
> > With 0 cells, how do you identify which device it is?
>
> we don't atm. We're relying on the default configuration.
I think Rob is speaking from DT API pov. What the driver is doing with
additional information is up to the driver.
> we don't have any APIs for AC configuration so I left the
> cell number to 0 thinking that the cell number might depend
> on the API.
>
> if need be, I can set it to the value I was initially thinking of in
> v4.
Which is?
According the TRM it's a bit tricky to define the API since you need to
describe two different types:
- master configuration
- peripheral configuration
One which came up in my mind is:
<&phandle TYPE ID VALUE>;
e.g.
<&aipstz AIPSTZ_MASTER 0 0xf>;
<&aipstz AIPSTZ_PERI 0 0xf>;
One could use a defien for the magic value of 0xf of course.
> >> + ranges: true
> >> +
> >> +# borrowed from simple-bus.yaml, no additional requirements for children
> >> +patternProperties:
> >> + "@(0|[1-9a-f][0-9a-f]*)$":
> >> + type: object
> >> + additionalProperties: true
> >> + properties:
> >> + reg:
> >> + items:
> >> + minItems: 2
> >> + maxItems: 4
> >> + minItems: 1
> >> + maxItems: 1024
> >> + ranges:
> >> + oneOf:
> >> + - items:
> >> + minItems: 3
> >> + maxItems: 7
> >> + minItems: 1
> >> + maxItems: 1024
> >> + - $ref: /schemas/types.yaml#/definitions/flag
> >> + anyOf:
> >> + - required:
> >> + - reg
> >> + - required:
> >> + - ranges
> >> +
> >> +required:
> >> + - compatible
> >> + - reg
> >> + - reg-names
> >> + - power-domains
> >> + - "#address-cells"
> >> + - "#size-cells"
> >> + - "#access-controller-cells"
> >> + - ranges
> >> +
> >> +additionalProperties: false
> >> +
> >> +examples:
> >> + - |
> >> + #include <dt-bindings/clock/imx8mp-clock.h>
> >> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> >> +
> >> + bus@30c00000 {
> >> + compatible = "fsl,imx8mp-aipstz";
> >> + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
> > It doesn't look like you have any registers in the 1st entry, but they
> > are child devices? Then you should use ranges and drop it here:
> >
> > ranges = <0x0 0x30c00000 0x400000>;
>
>
> I guess this would mean switching from global addresses (current way) to
> bus-relative addresses for the child devices. This wasn't my intent.
>
> I wonder if we could just switch to V2 in which we just use the bridge's AC
> configuration space and an empty 'ranges':
>
> aips5: bus@30df0000 {
> compatible = "fsl,imx8mp-aipstz";
> reg = <0x30df0000 0x10000>;
> /* some more properties here */
> ranges;
> };
>
> or as Marco just suggested use
>
> ranges = <0x30c00000 0x30c00000 0x400000>;
>
> instead of an empty 'ranges' to restrict the bus size.
>
> Personally, I'm fine with both approaches but what's your opinion on
> this?
Switching from a global addressing to a local one is not favourable IMHO
since NXP i.MX8M SoC TRMs are mention documenting all IPs with the
global addressing scheme. So yes either your v2 scheme or the one with
the limiting site but keeping the 1:1 mapping. Sorry again for the
ping-pong, wasn't that clear to me until now.
Regards,
Marco
> >> + reg-names = "bus", "ac";
> >> + power-domains = <&pgc_audio>;
> >> + #address-cells = <1>;
> >> + #size-cells = <1>;
> >> + #access-controller-cells = <0>;
> >> + ranges;
> >> +
> >> + dma-controller@30e00000 {
> >> + compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
> >> + reg = <0x30e00000 0x10000>;
> >> + #dma-cells = <3>;
> >> + clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
> >> + <&clk IMX8MP_CLK_AUDIO_ROOT>;
> >> + clock-names = "ipg", "ahb";
> >> + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
> >> + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
> > No 'access-controllers' here?
>
>
> no need for that unless the child wants to request a specific AC
> configuration for itself.
>
>
> >
> >> + };
> >> + };
> >> --
> >> 2.34.1
> >>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-31 6:41 ` Marco Felsch
@ 2025-03-31 11:57 ` Mihalcea Laurentiu
0 siblings, 0 replies; 13+ messages in thread
From: Mihalcea Laurentiu @ 2025-03-31 11:57 UTC (permalink / raw)
To: Marco Felsch
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marc Kleine-Budde, Pengutronix Kernel Team, devicetree,
imx, linux-arm-kernel, linux-kernel
On 31.03.2025 09:41, Marco Felsch wrote:
> On 25-03-28, Mihalcea Laurentiu wrote:
>> On 25.03.2025 05:23, Rob Herring wrote:
>>> On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
>>>> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>>>
>>>> Add documentation for IMX AIPSTZ bridge.
>>>>
>>>> Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
>>>> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
>>>> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>>> ---
>>>> .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
>>>> 1 file changed, 107 insertions(+)
>>>> create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>>>> new file mode 100644
>>>> index 000000000000..c0427dfcdaca
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
>>>> @@ -0,0 +1,107 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
>>>> +
>>>> +description:
>>>> + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
>>>> + issuing transactions to IP Slave peripherals. Additionally, this module
>>>> + offers access control configurations meant to restrict which peripherals
>>>> + a master can access.
>>> Wrap at 80 chars.
>>
>> fix in v4, thx
>>
>>>> +maintainers:
>>>> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>>> +
>>>> +properties:
>>>> + compatible:
>>>> + const: fsl,imx8mp-aipstz
>>>> +
>>>> + reg:
>>>> + maxItems: 2
>>>> +
>>>> + reg-names:
>>>> + items:
>>>> + - const: bus
>>>> + - const: ac
>>>> +
>>>> + power-domains:
>>>> + maxItems: 1
>>>> +
>>>> + "#address-cells":
>>>> + const: 1
>>>> +
>>>> + "#size-cells":
>>>> + const: 1
>>>> +
>>>> + "#access-controller-cells":
>>>> + const: 0
>>> With 0 cells, how do you identify which device it is?
>> we don't atm. We're relying on the default configuration.
> I think Rob is speaking from DT API pov. What the driver is doing with
> additional information is up to the driver.
>
>> we don't have any APIs for AC configuration so I left the
>> cell number to 0 thinking that the cell number might depend
>> on the API.
>>
>> if need be, I can set it to the value I was initially thinking of in
>> v4.
> Which is?
>
> According the TRM it's a bit tricky to define the API since you need to
> describe two different types:
> - master configuration
> - peripheral configuration
>
> One which came up in my mind is:
>
> <&phandle TYPE ID VALUE>;
>
> e.g.
>
> <&aipstz AIPSTZ_MASTER 0 0xf>;
> <&aipstz AIPSTZ_PERI 0 0xf>;
>
> One could use a defien for the magic value of 0xf of course.
so, my original idea was to use 2 cells: <&phandle ID VALUE>, where bit 0 of ID is used
to identify the IP type (master or slave/peripheral) and the rest of the bits are used to encode
the ID itself.
I think I like your idea a bit more though (i.e: have the TYPE as a separate cell)
because I think it's easier to deal with/understand from the DTS user's perspective.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
2025-03-28 12:34 ` Mihalcea Laurentiu
2025-03-31 6:41 ` Marco Felsch
@ 2025-03-31 14:15 ` Rob Herring
1 sibling, 0 replies; 13+ messages in thread
From: Rob Herring @ 2025-03-31 14:15 UTC (permalink / raw)
To: Mihalcea Laurentiu
Cc: Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Fabio Estevam, Daniel Baluta, Shengjiu Wang, Frank Li,
Marco Felsch, Marc Kleine-Budde, Pengutronix Kernel Team,
devicetree, imx, linux-arm-kernel, linux-kernel
On Fri, Mar 28, 2025 at 02:34:11PM +0200, Mihalcea Laurentiu wrote:
>
> On 25.03.2025 05:23, Rob Herring wrote:
> > On Mon, Mar 24, 2025 at 12:25:52PM -0400, Laurentiu Mihalcea wrote:
> >> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >>
> >> Add documentation for IMX AIPSTZ bridge.
> >>
> >> Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
> >> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> >> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >> ---
> >> .../bindings/bus/fsl,imx8mp-aipstz.yaml | 107 ++++++++++++++++++
> >> 1 file changed, 107 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >> new file mode 100644
> >> index 000000000000..c0427dfcdaca
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
> >> @@ -0,0 +1,107 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/bus/fsl,imx8mp-aipstz.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Secure AHB to IP Slave bus (AIPSTZ) bridge
> >> +
> >> +description:
> >> + The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
> >> + issuing transactions to IP Slave peripherals. Additionally, this module
> >> + offers access control configurations meant to restrict which peripherals
> >> + a master can access.
> > Wrap at 80 chars.
>
>
> fix in v4, thx
>
>
> >
> >> +
> >> +maintainers:
> >> + - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >> +
> >> +properties:
> >> + compatible:
> >> + const: fsl,imx8mp-aipstz
> >> +
> >> + reg:
> >> + maxItems: 2
> >> +
> >> + reg-names:
> >> + items:
> >> + - const: bus
> >> + - const: ac
> >> +
> >> + power-domains:
> >> + maxItems: 1
> >> +
> >> + "#address-cells":
> >> + const: 1
> >> +
> >> + "#size-cells":
> >> + const: 1
> >> +
> >> + "#access-controller-cells":
> >> + const: 0
> > With 0 cells, how do you identify which device it is?
>
>
> we don't atm. We're relying on the default configuration.
Then you don't really need the property at all. However, if you ever
need the non-default and configure it, adding it or changing it later is
an ABI issue. So better to define it correctly sooner rather than later.
>
>
> we don't have any APIs for AC configuration so I left the
>
> cell number to 0 thinking that the cell number might depend
>
> on the API.
>
>
> if need be, I can set it to the value I was initially thinking of in v4.
>
>
> >
> >> +
> >> + ranges: true
> >> +
> >> +# borrowed from simple-bus.yaml, no additional requirements for children
> >> +patternProperties:
> >> + "@(0|[1-9a-f][0-9a-f]*)$":
> >> + type: object
> >> + additionalProperties: true
> >> + properties:
> >> + reg:
> >> + items:
> >> + minItems: 2
> >> + maxItems: 4
> >> + minItems: 1
> >> + maxItems: 1024
> >> + ranges:
> >> + oneOf:
> >> + - items:
> >> + minItems: 3
> >> + maxItems: 7
> >> + minItems: 1
> >> + maxItems: 1024
> >> + - $ref: /schemas/types.yaml#/definitions/flag
> >> + anyOf:
> >> + - required:
> >> + - reg
> >> + - required:
> >> + - ranges
> >> +
> >> +required:
> >> + - compatible
> >> + - reg
> >> + - reg-names
> >> + - power-domains
> >> + - "#address-cells"
> >> + - "#size-cells"
> >> + - "#access-controller-cells"
> >> + - ranges
> >> +
> >> +additionalProperties: false
> >> +
> >> +examples:
> >> + - |
> >> + #include <dt-bindings/clock/imx8mp-clock.h>
> >> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> >> +
> >> + bus@30c00000 {
> >> + compatible = "fsl,imx8mp-aipstz";
> >> + reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
> > It doesn't look like you have any registers in the 1st entry, but they
> > are child devices? Then you should use ranges and drop it here:
> >
> > ranges = <0x0 0x30c00000 0x400000>;
>
>
> I guess this would mean switching from global addresses (current way) to
>
> bus-relative addresses for the child devices. This wasn't my intent.
>
>
> I wonder if we could just switch to V2 in which we just use the bridge's AC
>
> configuration space and an empty 'ranges':
>
>
> aips5: bus@30df0000 {
>
> compatible = "fsl,imx8mp-aipstz";
>
> reg = <0x30df0000 0x10000>;
>
> /* some more properties here */
>
> ranges;
>
> };
>
>
> or as Marco just suggested use
>
>
> ranges = <0x30c00000 0x30c00000 0x400000>;
>
>
> instead of an empty 'ranges' to restrict the bus size.
>
>
> Personally, I'm fine with both approaches but what's your opinion on this?
The latter restricting the size is my preference.
Rob
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 2/5] dt-bindings: dsp: fsl,dsp: document 'access-controllers' property
2025-03-24 16:25 [PATCH v3 0/5] imx8mp: add support for the IMX AIPSTZ bridge Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 1/5] dt-bindings: bus: add documentation " Laurentiu Mihalcea
@ 2025-03-24 16:25 ` Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 3/5] bus: add driver for IMX AIPSTZ bridge Laurentiu Mihalcea
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-03-24 16:25 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marco Felsch, Marc Kleine-Budde
Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Some DSP instances may have their access to certain peripherals
conditioned by a bus access controller such as the one from the
AIPSTZ bridge.
Add the optional 'access-controllers' property, which may be used
in such cases.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
Documentation/devicetree/bindings/dsp/fsl,dsp.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
index b8693e4b4b0d..e610b7636a08 100644
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
@@ -91,6 +91,9 @@ properties:
- const: runstall
- const: softreset
+ access-controllers:
+ maxItems: 1
+
required:
- compatible
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 3/5] bus: add driver for IMX AIPSTZ bridge
2025-03-24 16:25 [PATCH v3 0/5] imx8mp: add support for the IMX AIPSTZ bridge Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 1/5] dt-bindings: bus: add documentation " Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 2/5] dt-bindings: dsp: fsl,dsp: document 'access-controllers' property Laurentiu Mihalcea
@ 2025-03-24 16:25 ` Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 4/5] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 5/5] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
4 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-03-24 16:25 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marco Felsch, Marc Kleine-Budde
Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The secure AHB to IP Slave (AIPSTZ) bus bridge provides access control
configurations meant to restrict access to certain peripherals.
Some of the configurations include:
1) Marking masters as trusted for R/W. Based on this
(and the configuration of the accessed peripheral), the bridge
may choose to abort the R/W transactions issued by certain
masters.
2) Allowing/disallowing write accesses to peripherals.
Add driver for this IP. Since there's currently no framework for
access controllers (and since there's currently no need for having
flexibility w.r.t the configurations) all this driver does is it
applies a relaxed, "default" configuration, in which all masters
are trusted for R/W.
Note that some instances of this IP (e.g: AIPSTZ5 on i.MX8MP) may be tied
to a power domain and may lose their configuration when the domain is
powered off. This is why the configuration has to be restored when the
domain is powered on.
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
drivers/bus/Kconfig | 6 +++
drivers/bus/Makefile | 1 +
drivers/bus/imx-aipstz.c | 92 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 drivers/bus/imx-aipstz.c
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index ff669a8ccad9..fe7600283e70 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -87,6 +87,12 @@ config HISILICON_LPC
Driver to enable I/O access to devices attached to the Low Pin
Count bus on the HiSilicon Hip06/7 SoC.
+config IMX_AIPSTZ
+ tristate "Support for IMX Secure AHB to IP Slave bus (AIPSTZ) bridge"
+ depends on ARCH_MXC
+ help
+ Enable support for IMX AIPSTZ bridge.
+
config IMX_WEIM
bool "Freescale EIM DRIVER"
depends on ARCH_MXC || COMPILE_TEST
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index cddd4984d6af..8e693fe8a03a 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
obj-$(CONFIG_BT1_APB) += bt1-apb.o
obj-$(CONFIG_BT1_AXI) += bt1-axi.o
+obj-$(CONFIG_IMX_AIPSTZ) += imx-aipstz.o
obj-$(CONFIG_IMX_WEIM) += imx-weim.o
obj-$(CONFIG_INTEL_IXP4XX_EB) += intel-ixp4xx-eb.o
obj-$(CONFIG_MIPS_CDMM) += mips_cdmm.o
diff --git a/drivers/bus/imx-aipstz.c b/drivers/bus/imx-aipstz.c
new file mode 100644
index 000000000000..538ad89dba30
--- /dev/null
+++ b/drivers/bus/imx-aipstz.c
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2025 NXP
+ */
+
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+
+#define IMX_AIPSTZ_MPR0 0x0
+
+struct imx_aipstz_config {
+ u32 mpr0;
+};
+
+static void imx_aipstz_apply_default(void __iomem *base,
+ const struct imx_aipstz_config *default_cfg)
+{
+ writel(default_cfg->mpr0, base + IMX_AIPSTZ_MPR0);
+}
+
+static int imx_aipstz_probe(struct platform_device *pdev)
+{
+ const struct imx_aipstz_config *default_cfg;
+ void __iomem *base;
+
+ base = devm_platform_ioremap_resource_byname(pdev, "ac");
+ if (IS_ERR(base))
+ return dev_err_probe(&pdev->dev, -ENOMEM,
+ "failed to get/ioremap AC memory\n");
+
+ default_cfg = of_device_get_match_data(&pdev->dev);
+
+ imx_aipstz_apply_default(base, default_cfg);
+
+ dev_set_drvdata(&pdev->dev, base);
+
+ pm_runtime_set_active(&pdev->dev);
+ devm_pm_runtime_enable(&pdev->dev);
+
+ return devm_of_platform_populate(&pdev->dev);
+}
+
+static int imx_aipstz_runtime_resume(struct device *dev)
+{
+ const struct imx_aipstz_config *default_cfg;
+ void __iomem *base;
+
+ base = dev_get_drvdata(dev);
+ default_cfg = of_device_get_match_data(dev);
+
+ /* restore potentially lost configuration during domain power-off */
+ imx_aipstz_apply_default(base, default_cfg);
+
+ return 0;
+}
+
+static const struct dev_pm_ops imx_aipstz_pm_ops = {
+ RUNTIME_PM_OPS(NULL, imx_aipstz_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+};
+
+/*
+ * following configuration is equivalent to:
+ * masters 0-7 => trusted for R/W + use AHB's HPROT[1] to det. privilege
+ */
+static const struct imx_aipstz_config imx8mp_aipstz_default_cfg = {
+ .mpr0 = 0x77777777,
+};
+
+static const struct of_device_id imx_aipstz_of_ids[] = {
+ { .compatible = "fsl,imx8mp-aipstz", .data = &imx8mp_aipstz_default_cfg },
+ { }
+};
+MODULE_DEVICE_TABLE(of, imx_aipstz_of_ids);
+
+static struct platform_driver imx_aipstz_of_driver = {
+ .probe = imx_aipstz_probe,
+ .driver = {
+ .name = "imx-aipstz",
+ .of_match_table = imx_aipstz_of_ids,
+ .pm = pm_ptr(&imx_aipstz_pm_ops),
+ },
+};
+module_platform_driver(imx_aipstz_of_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("IMX secure AHB to IP Slave bus (AIPSTZ) bridge driver");
+MODULE_AUTHOR("Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>");
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 4/5] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
2025-03-24 16:25 [PATCH v3 0/5] imx8mp: add support for the IMX AIPSTZ bridge Laurentiu Mihalcea
` (2 preceding siblings ...)
2025-03-24 16:25 ` [PATCH v3 3/5] bus: add driver for IMX AIPSTZ bridge Laurentiu Mihalcea
@ 2025-03-24 16:25 ` Laurentiu Mihalcea
2025-03-24 16:25 ` [PATCH v3 5/5] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' Laurentiu Mihalcea
4 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-03-24 16:25 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marco Felsch, Marc Kleine-Budde
Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
AIPS5 is actually AIPSTZ5 as it offers some security-related
configurations. Since these configurations need to be applied before
accessing any of the peripherals on the bus, it's better to make AIPSTZ5
be their parent instead of keeping AIPS5 and adding a child node for
AIPSTZ5. Also, because of the security configurations, the address space
of the bus has to be changed to that of the configuration registers.
Finally, since AIPSTZ5 belongs to the AUDIOMIX power domain, add the
missing 'power-domains' property. The domain needs to be powered on before
attempting to configure the security-related registers.
The DT node name is not changed to avoid potential issues with DTs in
which this node is referenced.
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index ce6793b2d57e..ce9f6da1e257 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1400,10 +1400,13 @@ eqos: ethernet@30bf0000 {
};
aips5: bus@30c00000 {
- compatible = "fsl,aips-bus", "simple-bus";
- reg = <0x30c00000 0x400000>;
+ compatible = "fsl,imx8mp-aipstz";
+ reg = <0x30c00000 0x400000>, <0x30df0000 0x10000>;
+ reg-names = "bus", "ac";
+ power-domains = <&pgc_audio>;
#address-cells = <1>;
#size-cells = <1>;
+ #access-controller-cells = <0>;
ranges;
spba-bus@30c00000 {
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 5/5] arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'
2025-03-24 16:25 [PATCH v3 0/5] imx8mp: add support for the IMX AIPSTZ bridge Laurentiu Mihalcea
` (3 preceding siblings ...)
2025-03-24 16:25 ` [PATCH v3 4/5] arm64: dts: imx8mp: convert 'aips5' to 'aipstz5' Laurentiu Mihalcea
@ 2025-03-24 16:25 ` Laurentiu Mihalcea
4 siblings, 0 replies; 13+ messages in thread
From: Laurentiu Mihalcea @ 2025-03-24 16:25 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Fabio Estevam, Daniel Baluta, Shengjiu Wang,
Frank Li, Marco Felsch, Marc Kleine-Budde
Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The DSP needs to access peripherals on AIPSTZ5 (to communicate with
the AP using AUDIOMIX MU, for instance). To do so, the security-related
registers of the bridge have to be configured before the DSP is started.
Enforce a dependency on AIPSTZ5 by adding the 'access-controllers'
property to the 'dsp' node.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index ce9f6da1e257..db14e85023a0 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -2425,6 +2425,7 @@ dsp: dsp@3b6e8000 {
mboxes = <&mu2 2 0>, <&mu2 2 1>,
<&mu2 3 0>, <&mu2 3 1>;
memory-region = <&dsp_reserved>;
+ access-controllers = <&aips5>;
status = "disabled";
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 13+ messages in thread