...
...
15
15
16
Other masters should use the 'access-controllers' property to enforce
16
Other masters should use the 'access-controllers' property to enforce
17
a dependency between their device and the bridge device (see the DSP,
17
a dependency between their device and the bridge device (see the DSP,
18
for example).
18
for example).
19
19
20
At the moment, we only want to apply a default, more relaxed
21
configuration, which is why the number of access controller cells
22
is 0.
23
24
The initial version of the series can be found at [1]. The new version
20
The initial version of the series can be found at [1]. The new version
25
should provide better management of the device dependencies.
21
should provide better management of the device dependencies.
26
22
27
[1]: https://lore.kernel.org/linux-arm-kernel/20241119130726.2761726-1-daniel.baluta@nxp.com/
23
[1]: https://lore.kernel.org/linux-arm-kernel/20241119130726.2761726-1-daniel.baluta@nxp.com/
28
24
29
---
25
---
26
Changes in v5:
27
* merge imx-aipstz.h into imx8mp-aipstz.h. imx-aipstz.h is
28
currently only used in the DTS so it can't be added as a binding.
29
* place 'ranges' property just after 'reg' in the binding DT example
30
as Frank suggested.
31
* use the (1 << x) notation for the configuration bits. Previously,
32
hex values were used which didn't make it very clear that the
33
configuration options are bits.
34
* shorten the description of the bridge's AC cells.
35
* shorten the message of the commit introducing the bridge's binding.
36
* pick up some more R-b's on patches that remained untouched since V4.
37
* link to v4: https://lore.kernel.org/lkml/20250401154404.45932-1-laurentiumihalcea111@gmail.com/
38
39
Changes in v4:
40
* AIPS5 node now only contains a single memory region: that of the AC
41
(just like in V2). 'reg-names' property is dropped.
42
* AIPS5 node now uses 'ranges' property to restrict the size of the bus
43
(1:1 mapping)
44
* change the number of AC cells from 0 to 3
45
* add binding headers
46
* link to v3: https://lore.kernel.org/lkml/20250324162556.30972-1-laurentiumihalcea111@gmail.com/
47
48
Changes in v3:
49
* make '#address-cells' and '#size-cells' constants and equal to 1 in the
50
binding. The bus is 32-bit.
51
* add child node in the example DT snippet.
52
* the 'aips5' DT node now contains 2 memory regions: that of the
53
peripherals accessible via this bridge and that of the access controller.
54
* link to v2: https://lore.kernel.org/lkml/20250226165314.34205-1-laurentiumihalcea111@gmail.com/
55
30
Changes in v2:
56
Changes in v2:
31
* adress Frank Li's comments
57
* adress Frank Li's comments
32
* pick up some A-b/R-b's
58
* pick up some A-b/R-b's
33
* don't use "simple-bus" as the second compatible. As per Krzysztof's
59
* don't use "simple-bus" as the second compatible. As per Krzysztof's
34
comment, AIPSTZ is not a "simple-bus".
60
comment, AIPSTZ is not a "simple-bus".
61
* link to v1: https://lore.kernel.org/lkml/20250221191909.31874-1-laurentiumihalcea111@gmail.com/
35
---
62
---
36
63
37
Laurentiu Mihalcea (5):
64
Laurentiu Mihalcea (6):
38
dt-bindings: bus: add documentation for the IMX AIPSTZ bridge
65
dt-bindings: bus: document the IMX AIPSTZ bridge
39
dt-bindings: dsp: fsl,dsp: document 'access-controllers' property
66
dt-bindings: dsp: fsl,dsp: document 'access-controllers' property
40
bus: add driver for IMX AIPSTZ bridge
67
bus: add driver for IMX AIPSTZ bridge
41
arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
68
arm64: dts: imx8mp: convert 'aips5' to 'aipstz5'
69
arm64: dts: imx8mp: add aipstz-related definitions
42
arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'
70
arm64: dts: imx8mp: make 'dsp' node depend on 'aips5'
43
71
44
.../bindings/bus/fsl,imx8mp-aipstz.yaml | 86 +++++++++++++++++
72
.../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++
45
.../devicetree/bindings/dsp/fsl,dsp.yaml | 3 +
73
.../devicetree/bindings/dsp/fsl,dsp.yaml | 3 +
46
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 9 +-
74
arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 39 +++++++
47
drivers/bus/Kconfig | 6 ++
75
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 12 +-
48
drivers/bus/Makefile | 1 +
76
drivers/bus/Kconfig | 6 +
49
drivers/bus/imx-aipstz.c | 92 +++++++++++++++++++
77
drivers/bus/Makefile | 1 +
50
6 files changed, 194 insertions(+), 3 deletions(-)
78
drivers/bus/imx-aipstz.c | 92 ++++++++++++++++
79
7 files changed, 253 insertions(+), 4 deletions(-)
51
create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
80
create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
81
create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
52
create mode 100644 drivers/bus/imx-aipstz.c
82
create mode 100644 drivers/bus/imx-aipstz.c
53
83
54
--
84
--
55
2.34.1
85
2.34.1
diff view generated by jsdifflib
...
...
4
4
5
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
5
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
6
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
6
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
7
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
7
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
8
---
8
---
9
.../bindings/bus/fsl,imx8mp-aipstz.yaml | 86 +++++++++++++++++++
9
.../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++
10
1 file changed, 86 insertions(+)
10
1 file changed, 104 insertions(+)
11
create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
11
create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
12
12
13
diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
13
diff --git a/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml b/Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml
14
new file mode 100644
14
new file mode 100644
15
index XXXXXXX..XXXXXXX
15
index XXXXXXX..XXXXXXX
...
...
23
+$schema: http://devicetree.org/meta-schemas/core.yaml#
23
+$schema: http://devicetree.org/meta-schemas/core.yaml#
24
+
24
+
25
+title: Secure AHB to IP Slave bus (AIPSTZ) bridge
25
+title: Secure AHB to IP Slave bus (AIPSTZ) bridge
26
+
26
+
27
+description:
27
+description:
28
+ The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters
28
+ The secure AIPS bridge (AIPSTZ) acts as a bridge for AHB masters issuing
29
+ issuing transactions to IP Slave peripherals. Additionally, this module
29
+ transactions to IP Slave peripherals. Additionally, this module offers access
30
+ offers access control configurations meant to restrict which peripherals
30
+ control configurations meant to restrict which peripherals a master can
31
+ a master can access.
31
+ access.
32
+
32
+
33
+maintainers:
33
+maintainers:
34
+ - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
34
+ - Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
35
+
35
+
36
+properties:
36
+properties:
...
...
42
+
42
+
43
+ power-domains:
43
+ power-domains:
44
+ maxItems: 1
44
+ maxItems: 1
45
+
45
+
46
+ "#address-cells":
46
+ "#address-cells":
47
+ enum: [1, 2]
47
+ const: 1
48
+
48
+
49
+ "#size-cells":
49
+ "#size-cells":
50
+ enum: [1, 2]
50
+ const: 1
51
+
51
+
52
+ "#access-controller-cells":
52
+ "#access-controller-cells":
53
+ const: 0
53
+ const: 3
54
+ description:
55
+ First cell - consumer type (master or peripheral)
56
+ Second cell - consumer ID
57
+ Third cell - configuration value
54
+
58
+
55
+ ranges: true
59
+ ranges: true
56
+
60
+
57
+# borrowed from simple-bus.yaml, no additional requirements for children
61
+# borrowed from simple-bus.yaml, no additional requirements for children
58
+patternProperties:
62
+patternProperties:
...
...
91
+
95
+
92
+additionalProperties: false
96
+additionalProperties: false
93
+
97
+
94
+examples:
98
+examples:
95
+ - |
99
+ - |
100
+ #include <dt-bindings/clock/imx8mp-clock.h>
101
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
102
+
96
+ bus@30df0000 {
103
+ bus@30df0000 {
97
+ compatible = "fsl,imx8mp-aipstz";
104
+ compatible = "fsl,imx8mp-aipstz";
98
+ reg = <0x30df0000 0x10000>;
105
+ reg = <0x30df0000 0x10000>;
99
+ power-domains = <&pgc_audio>;
106
+ ranges = <0x30c00000 0x30c00000 0x400000>;
100
+ #address-cells = <1>;
107
+ power-domains = <&pgc_audio>;
101
+ #size-cells = <1>;
108
+ #address-cells = <1>;
102
+ #access-controller-cells = <0>;
109
+ #size-cells = <1>;
103
+ ranges;
110
+ #access-controller-cells = <3>;
111
+
112
+ dma-controller@30e00000 {
113
+ compatible = "fsl,imx8mp-sdma", "fsl,imx8mq-sdma";
114
+ reg = <0x30e00000 0x10000>;
115
+ #dma-cells = <3>;
116
+ clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SDMA3_ROOT>,
117
+ <&clk IMX8MP_CLK_AUDIO_ROOT>;
118
+ clock-names = "ipg", "ahb";
119
+ interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
120
+ fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
121
+ };
104
+ };
122
+ };
105
--
123
--
106
2.34.1
124
2.34.1
diff view generated by jsdifflib
...
...
17
diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
17
diff --git a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
18
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
19
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
19
--- a/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
20
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
20
+++ b/Documentation/devicetree/bindings/dsp/fsl,dsp.yaml
21
@@ -XXX,XX +XXX,XX @@ properties:
21
@@ -XXX,XX +XXX,XX @@ properties:
22
description:
22
- const: runstall
23
Phandle to syscon block which provide access for processor enablement
23
- const: softreset
24
24
25
+ access-controllers:
25
+ access-controllers:
26
+ maxItems: 1
26
+ maxItems: 1
27
+
27
+
28
required:
28
required:
29
- compatible
29
- compatible
30
- reg
30
- reg
31
--
31
--
32
2.34.1
32
2.34.1
diff view generated by jsdifflib
...
...
97
+    void __iomem *base;
97
+    void __iomem *base;
98
+
98
+
99
+    base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
99
+    base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
100
+    if (IS_ERR(base))
100
+    if (IS_ERR(base))
101
+        return dev_err_probe(&pdev->dev, -ENOMEM,
101
+        return dev_err_probe(&pdev->dev, -ENOMEM,
102
+                 "failed to get/ioremap memory\n");
102
+                 "failed to get/ioremap AC memory\n");
103
+
103
+
104
+    default_cfg = of_device_get_match_data(&pdev->dev);
104
+    default_cfg = of_device_get_match_data(&pdev->dev);
105
+
105
+
106
+    imx_aipstz_apply_default(base, default_cfg);
106
+    imx_aipstz_apply_default(base, default_cfg);
107
+
107
+
...
...
diff view generated by jsdifflib
...
...
15
which this node is referenced.
15
which this node is referenced.
16
16
17
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
17
Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com>
18
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
18
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
19
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
19
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
20
Reviewed-by: Frank Li <Frank.Li@nxp.com>
20
---
21
---
21
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 8 +++++---
22
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 10 ++++++----
22
1 file changed, 5 insertions(+), 3 deletions(-)
23
1 file changed, 6 insertions(+), 4 deletions(-)
23
24
24
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
25
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
25
index XXXXXXX..XXXXXXX 100644
26
index XXXXXXX..XXXXXXX 100644
26
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
27
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
27
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
28
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
...
...
36
+            compatible = "fsl,imx8mp-aipstz";
37
+            compatible = "fsl,imx8mp-aipstz";
37
+            reg = <0x30df0000 0x10000>;
38
+            reg = <0x30df0000 0x10000>;
38
+            power-domains = <&pgc_audio>;
39
+            power-domains = <&pgc_audio>;
39
            #address-cells = <1>;
40
            #address-cells = <1>;
40
            #size-cells = <1>;
41
            #size-cells = <1>;
41
+            #access-controller-cells = <0>;
42
-            ranges;
42
            ranges;
43
+            #access-controller-cells = <3>;
44
+            ranges = <0x30c00000 0x30c00000 0x400000>;
43
45
44
            spba-bus@30c00000 {
46
            spba-bus@30c00000 {
47
                compatible = "fsl,spba-bus", "simple-bus";
45
--
48
--
46
2.34.1
49
2.34.1
diff view generated by jsdifflib
New patch
1
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
1
2
3
Add header file with AIPSTZ-related definitions: consumer types,
4
master/peripheral configuration bits, and master ID definitions.
5
6
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
7
---
8
arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 39 +++++++++++++++++++
9
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 +
10
2 files changed, 40 insertions(+)
11
create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
12
13
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h b/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
14
new file mode 100644
15
index XXXXXXX..XXXXXXX
16
--- /dev/null
17
+++ b/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h
18
@@ -XXX,XX +XXX,XX @@
19
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
20
+/*
21
+ * Copyright 2025 NXP
22
+ */
23
+
24
+#ifndef __IMX8MP_AIPSTZ_H
25
+#define __IMX8MP_AIPSTZ_H
26
+
27
+/* consumer type - master or peripheral */
28
+#define IMX8MP_AIPSTZ_MASTER 0x0
29
+#define IMX8MP_AIPSTZ_PERIPH 0x1
30
+
31
+/* master configuration options */
32
+#define IMX8MP_AIPSTZ_MPL (1 << 0)
33
+#define IMX8MP_AIPSTZ_MTW (1 << 1)
34
+#define IMX8MP_AIPSTZ_MTR (1 << 2)
35
+#define IMX8MP_AIPSTZ_MBW (1 << 3)
36
+
37
+/* peripheral configuration options */
38
+#define IMX8MP_AIPSTZ_TP (1 << 0)
39
+#define IMX8MP_AIPSTZ_WP (1 << 1)
40
+#define IMX8MP_AIPSTZ_SP (1 << 2)
41
+#define IMX8MP_AIPSTZ_BW (1 << 3)
42
+
43
+/* master ID definitions */
44
+#define IMX8MP_AIPSTZ_EDMA 0 /* AUDIOMIX EDMA */
45
+#define IMX8MP_AIPSTZ_CA53 1 /* Cortex-A53 cluster */
46
+#define IMX8MP_AIPSTZ_SDMA2 3 /* AUDIOMIX SDMA2 */
47
+#define IMX8MP_AIPSTZ_SDMA3 3 /* AUDIOMIX SDMA3 */
48
+#define IMX8MP_AIPSTZ_HIFI4 5 /* HIFI4 DSP */
49
+#define IMX8MP_AIPSTZ_CM7 6 /* Cortex-M7 */
50
+
51
+/* helper macros */
52
+#define IMX8MP_AIPSTZ_HIFI4_T_RW_PL                    \
53
+    IMX8MP_AIPSTZ_MASTER                        \
54
+    IMX8MP_AIPSTZ_HIFI4                        \
55
+    (IMX8MP_AIPSTZ_MPL | IMX8MP_AIPSTZ_MTW | IMX8MP_AIPSTZ_MTR)
56
+
57
+#endif /* __IMX8MP_AIPSTZ_H */
58
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
59
index XXXXXXX..XXXXXXX 100644
60
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
61
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
62
@@ -XXX,XX +XXX,XX @@
63
#include <dt-bindings/interrupt-controller/arm-gic.h>
64
#include <dt-bindings/thermal/thermal.h>
65
66
+#include "imx8mp-aipstz.h"
67
#include "imx8mp-pinfunc.h"
68
69
/ {
70
--
71
2.34.1
diff view generated by jsdifflib
...
...
5
registers of the bridge have to be configured before the DSP is started.
5
registers of the bridge have to be configured before the DSP is started.
6
Enforce a dependency on AIPSTZ5 by adding the 'access-controllers'
6
Enforce a dependency on AIPSTZ5 by adding the 'access-controllers'
7
property to the 'dsp' node.
7
property to the 'dsp' node.
8
8
9
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
9
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
10
Reviewed-by: Frank Li <Frank.Li@nxp.com>
10
---
11
---
11
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 +
12
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 +
12
1 file changed, 1 insertion(+)
13
1 file changed, 1 insertion(+)
13
14
14
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
15
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
...
...
17
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
18
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
18
@@ -XXX,XX +XXX,XX @@ dsp: dsp@3b6e8000 {
19
@@ -XXX,XX +XXX,XX @@ dsp: dsp@3b6e8000 {
19
            mboxes = <&mu2 2 0>, <&mu2 2 1>,
20
            mboxes = <&mu2 2 0>, <&mu2 2 1>,
20
                <&mu2 3 0>, <&mu2 3 1>;
21
                <&mu2 3 0>, <&mu2 3 1>;
21
            memory-region = <&dsp_reserved>;
22
            memory-region = <&dsp_reserved>;
22
+            access-controllers = <&aips5>;
23
+            access-controllers = <&aips5 IMX8MP_AIPSTZ_HIFI4_T_RW_PL>;
23
            status = "disabled";
24
            status = "disabled";
24
        };
25
        };
25
    };
26
    };
26
--
27
--
27
2.34.1
28
2.34.1
diff view generated by jsdifflib