... | ... | ||
---|---|---|---|
21 | should provide better management of the device dependencies. | 21 | should provide better management of the device dependencies. |
22 | 22 | ||
23 | [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/ |
24 | 24 | ||
25 | --- | 25 | --- |
26 | Changes in v6: | ||
27 | * drop the 'IMX8MP_AIPSTZ_HIFI4_T_RW_PL' macro. Its whole point was to | ||
28 | help with making the DTS more readable but if it makes it look worse | ||
29 | then there's no point in keeping it. | ||
30 | * use consumer ID as first AC cell and consumer type as the second cell. | ||
31 | Better to go with a format that more people are used to as long as it | ||
32 | still makes sense. | ||
33 | * pick up Rob's R-b | ||
34 | * link to v5: https://lore.kernel.org/lkml/20250408154236.49421-1-laurentiumihalcea111@gmail.com/ | ||
35 | |||
26 | Changes in v5: | 36 | Changes in v5: |
27 | * merge imx-aipstz.h into imx8mp-aipstz.h. imx-aipstz.h is | 37 | * 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. | 38 | 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 | 39 | * place 'ranges' property just after 'reg' in the binding DT example |
30 | as Frank suggested. | 40 | as Frank suggested. |
... | ... | ||
69 | arm64: dts: imx8mp: add aipstz-related definitions | 79 | arm64: dts: imx8mp: add aipstz-related definitions |
70 | arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' | 80 | arm64: dts: imx8mp: make 'dsp' node depend on 'aips5' |
71 | 81 | ||
72 | .../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++ | 82 | .../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++ |
73 | .../devicetree/bindings/dsp/fsl,dsp.yaml | 3 + | 83 | .../devicetree/bindings/dsp/fsl,dsp.yaml | 3 + |
74 | arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 39 +++++++ | 84 | arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 33 ++++++ |
75 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 12 +- | 85 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 16 ++- |
76 | drivers/bus/Kconfig | 6 + | 86 | drivers/bus/Kconfig | 6 + |
77 | drivers/bus/Makefile | 1 + | 87 | drivers/bus/Makefile | 1 + |
78 | drivers/bus/imx-aipstz.c | 92 ++++++++++++++++ | 88 | drivers/bus/imx-aipstz.c | 92 ++++++++++++++++ |
79 | 7 files changed, 253 insertions(+), 4 deletions(-) | 89 | 7 files changed, 251 insertions(+), 4 deletions(-) |
80 | create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml | 90 | create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml |
81 | create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 91 | create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h |
82 | create mode 100644 drivers/bus/imx-aipstz.c | 92 | create mode 100644 drivers/bus/imx-aipstz.c |
83 | 93 | ||
84 | -- | 94 | -- |
85 | 2.34.1 | 95 | 2.34.1 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
3 | Add documentation for IMX AIPSTZ bridge. | 3 | Add documentation for IMX AIPSTZ bridge. |
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 | Reviewed-by: Rob Herring (Arm) <robh@kernel.org> | ||
8 | --- | 9 | --- |
9 | .../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++ | 10 | .../bindings/bus/fsl,imx8mp-aipstz.yaml | 104 ++++++++++++++++++ |
10 | 1 file changed, 104 insertions(+) | 11 | 1 file changed, 104 insertions(+) |
11 | create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml | 12 | create mode 100644 Documentation/devicetree/bindings/bus/fsl,imx8mp-aipstz.yaml |
12 | 13 | ||
... | ... | ||
50 | + const: 1 | 51 | + const: 1 |
51 | + | 52 | + |
52 | + "#access-controller-cells": | 53 | + "#access-controller-cells": |
53 | + const: 3 | 54 | + const: 3 |
54 | + description: | 55 | + description: |
55 | + First cell - consumer type (master or peripheral) | 56 | + First cell - consumer ID |
56 | + Second cell - consumer ID | 57 | + Second cell - consumer type (master or peripheral) |
57 | + Third cell - configuration value | 58 | + Third cell - configuration value |
58 | + | 59 | + |
59 | + ranges: true | 60 | + ranges: true |
60 | + | 61 | + |
61 | +# borrowed from simple-bus.yaml, no additional requirements for children | 62 | +# borrowed from simple-bus.yaml, no additional requirements for children |
... | ... | diff view generated by jsdifflib |
1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
---|---|---|---|
2 | 2 | ||
3 | Some DSP instances may have their access to certain peripherals | 3 | Some DSP instances may have their access to certain peripherals |
4 | conditioned by a bus access controller such as the one from the | 4 | conditioned by a bus access controller such as the one from the |
5 | AIPSTZ bridge. | 5 | AIPSTZ bridge. |
6 | 6 | ||
7 | Add the optional 'access-controllers' property, which may be used | 7 | Add the optional 'access-controllers' property, which may be used |
8 | in such cases. | 8 | in such cases. |
9 | 9 | ||
10 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 10 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
11 | Reviewed-by: Frank Li <Frank.Li@nxp.com> | 11 | Reviewed-by: Frank Li <Frank.Li@nxp.com> |
12 | Acked-by: Rob Herring (Arm) <robh@kernel.org> | 12 | Acked-by: Rob Herring (Arm) <robh@kernel.org> |
13 | --- | 13 | --- |
14 | Documentation/devicetree/bindings/dsp/fsl,dsp.yaml | 3 +++ | 14 | Documentation/devicetree/bindings/dsp/fsl,dsp.yaml | 3 +++ |
15 | 1 file changed, 3 insertions(+) | 15 | 1 file changed, 3 insertions(+) |
16 | 16 | ||
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 | - const: runstall | 22 | - const: runstall |
23 | - const: softreset | 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 |
1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
---|---|---|---|
2 | 2 | ||
3 | The secure AHB to IP Slave (AIPSTZ) bus bridge provides access control | 3 | The secure AHB to IP Slave (AIPSTZ) bus bridge provides access control |
4 | configurations meant to restrict access to certain peripherals. | 4 | configurations meant to restrict access to certain peripherals. |
5 | Some of the configurations include: | 5 | Some of the configurations include: |
6 | 6 | ||
7 | 1) Marking masters as trusted for R/W. Based on this | 7 | 1) Marking masters as trusted for R/W. Based on this |
8 | (and the configuration of the accessed peripheral), the bridge | 8 | (and the configuration of the accessed peripheral), the bridge |
9 | may choose to abort the R/W transactions issued by certain | 9 | may choose to abort the R/W transactions issued by certain |
10 | masters. | 10 | masters. |
11 | 11 | ||
12 | 2) Allowing/disallowing write accesses to peripherals. | 12 | 2) Allowing/disallowing write accesses to peripherals. |
13 | 13 | ||
14 | Add driver for this IP. Since there's currently no framework for | 14 | Add driver for this IP. Since there's currently no framework for |
15 | access controllers (and since there's currently no need for having | 15 | access controllers (and since there's currently no need for having |
16 | flexibility w.r.t the configurations) all this driver does is it | 16 | flexibility w.r.t the configurations) all this driver does is it |
17 | applies a relaxed, "default" configuration, in which all masters | 17 | applies a relaxed, "default" configuration, in which all masters |
18 | are trusted for R/W. | 18 | are trusted for R/W. |
19 | 19 | ||
20 | Note that some instances of this IP (e.g: AIPSTZ5 on i.MX8MP) may be tied | 20 | Note that some instances of this IP (e.g: AIPSTZ5 on i.MX8MP) may be tied |
21 | to a power domain and may lose their configuration when the domain is | 21 | to a power domain and may lose their configuration when the domain is |
22 | powered off. This is why the configuration has to be restored when the | 22 | powered off. This is why the configuration has to be restored when the |
23 | domain is powered on. | 23 | domain is powered on. |
24 | 24 | ||
25 | Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com> | 25 | Co-developed-by: Daniel Baluta <daniel.baluta@nxp.com> |
26 | Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> | 26 | Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> |
27 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 27 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
28 | --- | 28 | --- |
29 | drivers/bus/Kconfig | 6 +++ | 29 | drivers/bus/Kconfig | 6 +++ |
30 | drivers/bus/Makefile | 1 + | 30 | drivers/bus/Makefile | 1 + |
31 | drivers/bus/imx-aipstz.c | 92 ++++++++++++++++++++++++++++++++++++++++ | 31 | drivers/bus/imx-aipstz.c | 92 ++++++++++++++++++++++++++++++++++++++++ |
32 | 3 files changed, 99 insertions(+) | 32 | 3 files changed, 99 insertions(+) |
33 | create mode 100644 drivers/bus/imx-aipstz.c | 33 | create mode 100644 drivers/bus/imx-aipstz.c |
34 | 34 | ||
35 | diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig | 35 | diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig |
36 | index XXXXXXX..XXXXXXX 100644 | 36 | index XXXXXXX..XXXXXXX 100644 |
37 | --- a/drivers/bus/Kconfig | 37 | --- a/drivers/bus/Kconfig |
38 | +++ b/drivers/bus/Kconfig | 38 | +++ b/drivers/bus/Kconfig |
39 | @@ -XXX,XX +XXX,XX @@ config HISILICON_LPC | 39 | @@ -XXX,XX +XXX,XX @@ config HISILICON_LPC |
40 | Driver to enable I/O access to devices attached to the Low Pin | 40 | Driver to enable I/O access to devices attached to the Low Pin |
41 | Count bus on the HiSilicon Hip06/7 SoC. | 41 | Count bus on the HiSilicon Hip06/7 SoC. |
42 | 42 | ||
43 | +config IMX_AIPSTZ | 43 | +config IMX_AIPSTZ |
44 | + tristate "Support for IMX Secure AHB to IP Slave bus (AIPSTZ) bridge" | 44 | + tristate "Support for IMX Secure AHB to IP Slave bus (AIPSTZ) bridge" |
45 | + depends on ARCH_MXC | 45 | + depends on ARCH_MXC |
46 | + help | 46 | + help |
47 | + Enable support for IMX AIPSTZ bridge. | 47 | + Enable support for IMX AIPSTZ bridge. |
48 | + | 48 | + |
49 | config IMX_WEIM | 49 | config IMX_WEIM |
50 | bool "Freescale EIM DRIVER" | 50 | bool "Freescale EIM DRIVER" |
51 | depends on ARCH_MXC || COMPILE_TEST | 51 | depends on ARCH_MXC || COMPILE_TEST |
52 | diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile | 52 | diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile |
53 | index XXXXXXX..XXXXXXX 100644 | 53 | index XXXXXXX..XXXXXXX 100644 |
54 | --- a/drivers/bus/Makefile | 54 | --- a/drivers/bus/Makefile |
55 | +++ b/drivers/bus/Makefile | 55 | +++ b/drivers/bus/Makefile |
56 | @@ -XXX,XX +XXX,XX @@ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ | 56 | @@ -XXX,XX +XXX,XX @@ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ |
57 | 57 | ||
58 | obj-$(CONFIG_BT1_APB) += bt1-apb.o | 58 | obj-$(CONFIG_BT1_APB) += bt1-apb.o |
59 | obj-$(CONFIG_BT1_AXI) += bt1-axi.o | 59 | obj-$(CONFIG_BT1_AXI) += bt1-axi.o |
60 | +obj-$(CONFIG_IMX_AIPSTZ) += imx-aipstz.o | 60 | +obj-$(CONFIG_IMX_AIPSTZ) += imx-aipstz.o |
61 | obj-$(CONFIG_IMX_WEIM) += imx-weim.o | 61 | obj-$(CONFIG_IMX_WEIM) += imx-weim.o |
62 | obj-$(CONFIG_INTEL_IXP4XX_EB) += intel-ixp4xx-eb.o | 62 | obj-$(CONFIG_INTEL_IXP4XX_EB) += intel-ixp4xx-eb.o |
63 | obj-$(CONFIG_MIPS_CDMM) += mips_cdmm.o | 63 | obj-$(CONFIG_MIPS_CDMM) += mips_cdmm.o |
64 | diff --git a/drivers/bus/imx-aipstz.c b/drivers/bus/imx-aipstz.c | 64 | diff --git a/drivers/bus/imx-aipstz.c b/drivers/bus/imx-aipstz.c |
65 | new file mode 100644 | 65 | new file mode 100644 |
66 | index XXXXXXX..XXXXXXX | 66 | index XXXXXXX..XXXXXXX |
67 | --- /dev/null | 67 | --- /dev/null |
68 | +++ b/drivers/bus/imx-aipstz.c | 68 | +++ b/drivers/bus/imx-aipstz.c |
69 | @@ -XXX,XX +XXX,XX @@ | 69 | @@ -XXX,XX +XXX,XX @@ |
70 | +// SPDX-License-Identifier: GPL-2.0 | 70 | +// SPDX-License-Identifier: GPL-2.0 |
71 | +/* | 71 | +/* |
72 | + * Copyright 2025 NXP | 72 | + * Copyright 2025 NXP |
73 | + */ | 73 | + */ |
74 | + | 74 | + |
75 | +#include <linux/module.h> | 75 | +#include <linux/module.h> |
76 | +#include <linux/of.h> | 76 | +#include <linux/of.h> |
77 | +#include <linux/of_platform.h> | 77 | +#include <linux/of_platform.h> |
78 | +#include <linux/platform_device.h> | 78 | +#include <linux/platform_device.h> |
79 | +#include <linux/pm_runtime.h> | 79 | +#include <linux/pm_runtime.h> |
80 | +#include <linux/regmap.h> | 80 | +#include <linux/regmap.h> |
81 | + | 81 | + |
82 | +#define IMX_AIPSTZ_MPR0 0x0 | 82 | +#define IMX_AIPSTZ_MPR0 0x0 |
83 | + | 83 | + |
84 | +struct imx_aipstz_config { | 84 | +struct imx_aipstz_config { |
85 | + u32 mpr0; | 85 | + u32 mpr0; |
86 | +}; | 86 | +}; |
87 | + | 87 | + |
88 | +static void imx_aipstz_apply_default(void __iomem *base, | 88 | +static void imx_aipstz_apply_default(void __iomem *base, |
89 | + const struct imx_aipstz_config *default_cfg) | 89 | + const struct imx_aipstz_config *default_cfg) |
90 | +{ | 90 | +{ |
91 | + writel(default_cfg->mpr0, base + IMX_AIPSTZ_MPR0); | 91 | + writel(default_cfg->mpr0, base + IMX_AIPSTZ_MPR0); |
92 | +} | 92 | +} |
93 | + | 93 | + |
94 | +static int imx_aipstz_probe(struct platform_device *pdev) | 94 | +static int imx_aipstz_probe(struct platform_device *pdev) |
95 | +{ | 95 | +{ |
96 | + const struct imx_aipstz_config *default_cfg; | 96 | + const struct imx_aipstz_config *default_cfg; |
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 AC 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 | + |
108 | + dev_set_drvdata(&pdev->dev, base); | 108 | + dev_set_drvdata(&pdev->dev, base); |
109 | + | 109 | + |
110 | + pm_runtime_set_active(&pdev->dev); | 110 | + pm_runtime_set_active(&pdev->dev); |
111 | + devm_pm_runtime_enable(&pdev->dev); | 111 | + devm_pm_runtime_enable(&pdev->dev); |
112 | + | 112 | + |
113 | + return devm_of_platform_populate(&pdev->dev); | 113 | + return devm_of_platform_populate(&pdev->dev); |
114 | +} | 114 | +} |
115 | + | 115 | + |
116 | +static int imx_aipstz_runtime_resume(struct device *dev) | 116 | +static int imx_aipstz_runtime_resume(struct device *dev) |
117 | +{ | 117 | +{ |
118 | + const struct imx_aipstz_config *default_cfg; | 118 | + const struct imx_aipstz_config *default_cfg; |
119 | + void __iomem *base; | 119 | + void __iomem *base; |
120 | + | 120 | + |
121 | + base = dev_get_drvdata(dev); | 121 | + base = dev_get_drvdata(dev); |
122 | + default_cfg = of_device_get_match_data(dev); | 122 | + default_cfg = of_device_get_match_data(dev); |
123 | + | 123 | + |
124 | + /* restore potentially lost configuration during domain power-off */ | 124 | + /* restore potentially lost configuration during domain power-off */ |
125 | + imx_aipstz_apply_default(base, default_cfg); | 125 | + imx_aipstz_apply_default(base, default_cfg); |
126 | + | 126 | + |
127 | + return 0; | 127 | + return 0; |
128 | +} | 128 | +} |
129 | + | 129 | + |
130 | +static const struct dev_pm_ops imx_aipstz_pm_ops = { | 130 | +static const struct dev_pm_ops imx_aipstz_pm_ops = { |
131 | + RUNTIME_PM_OPS(NULL, imx_aipstz_runtime_resume, NULL) | 131 | + RUNTIME_PM_OPS(NULL, imx_aipstz_runtime_resume, NULL) |
132 | + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) | 132 | + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) |
133 | +}; | 133 | +}; |
134 | + | 134 | + |
135 | +/* | 135 | +/* |
136 | + * following configuration is equivalent to: | 136 | + * following configuration is equivalent to: |
137 | + * masters 0-7 => trusted for R/W + use AHB's HPROT[1] to det. privilege | 137 | + * masters 0-7 => trusted for R/W + use AHB's HPROT[1] to det. privilege |
138 | + */ | 138 | + */ |
139 | +static const struct imx_aipstz_config imx8mp_aipstz_default_cfg = { | 139 | +static const struct imx_aipstz_config imx8mp_aipstz_default_cfg = { |
140 | + .mpr0 = 0x77777777, | 140 | + .mpr0 = 0x77777777, |
141 | +}; | 141 | +}; |
142 | + | 142 | + |
143 | +static const struct of_device_id imx_aipstz_of_ids[] = { | 143 | +static const struct of_device_id imx_aipstz_of_ids[] = { |
144 | + { .compatible = "fsl,imx8mp-aipstz", .data = &imx8mp_aipstz_default_cfg }, | 144 | + { .compatible = "fsl,imx8mp-aipstz", .data = &imx8mp_aipstz_default_cfg }, |
145 | + { } | 145 | + { } |
146 | +}; | 146 | +}; |
147 | +MODULE_DEVICE_TABLE(of, imx_aipstz_of_ids); | 147 | +MODULE_DEVICE_TABLE(of, imx_aipstz_of_ids); |
148 | + | 148 | + |
149 | +static struct platform_driver imx_aipstz_of_driver = { | 149 | +static struct platform_driver imx_aipstz_of_driver = { |
150 | + .probe = imx_aipstz_probe, | 150 | + .probe = imx_aipstz_probe, |
151 | + .driver = { | 151 | + .driver = { |
152 | + .name = "imx-aipstz", | 152 | + .name = "imx-aipstz", |
153 | + .of_match_table = imx_aipstz_of_ids, | 153 | + .of_match_table = imx_aipstz_of_ids, |
154 | + .pm = pm_ptr(&imx_aipstz_pm_ops), | 154 | + .pm = pm_ptr(&imx_aipstz_pm_ops), |
155 | + }, | 155 | + }, |
156 | +}; | 156 | +}; |
157 | +module_platform_driver(imx_aipstz_of_driver); | 157 | +module_platform_driver(imx_aipstz_of_driver); |
158 | + | 158 | + |
159 | +MODULE_LICENSE("GPL"); | 159 | +MODULE_LICENSE("GPL"); |
160 | +MODULE_DESCRIPTION("IMX secure AHB to IP Slave bus (AIPSTZ) bridge driver"); | 160 | +MODULE_DESCRIPTION("IMX secure AHB to IP Slave bus (AIPSTZ) bridge driver"); |
161 | +MODULE_AUTHOR("Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>"); | 161 | +MODULE_AUTHOR("Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>"); |
162 | -- | 162 | -- |
163 | 2.34.1 | 163 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 1 | From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
---|---|---|---|
2 | 2 | ||
3 | AIPS5 is actually AIPSTZ5 as it offers some security-related | 3 | AIPS5 is actually AIPSTZ5 as it offers some security-related |
4 | configurations. Since these configurations need to be applied before | 4 | configurations. Since these configurations need to be applied before |
5 | accessing any of the peripherals on the bus, it's better to make AIPSTZ5 | 5 | accessing any of the peripherals on the bus, it's better to make AIPSTZ5 |
6 | be their parent instead of keeping AIPS5 and adding a child node for | 6 | be their parent instead of keeping AIPS5 and adding a child node for |
7 | AIPSTZ5. Also, because of the security configurations, the address space | 7 | AIPSTZ5. Also, because of the security configurations, the address space |
8 | of the bus has to be changed to that of the configuration registers. | 8 | of the bus has to be changed to that of the configuration registers. |
9 | 9 | ||
10 | Finally, since AIPSTZ5 belongs to the AUDIOMIX power domain, add the | 10 | Finally, since AIPSTZ5 belongs to the AUDIOMIX power domain, add the |
11 | missing 'power-domains' property. The domain needs to be powered on before | 11 | missing 'power-domains' property. The domain needs to be powered on before |
12 | attempting to configure the security-related registers. | 12 | attempting to configure the security-related registers. |
13 | 13 | ||
14 | The DT node name is not changed to avoid potential issues with DTs in | 14 | The DT node name is not changed to avoid potential issues with DTs in |
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 | Reviewed-by: Frank Li <Frank.Li@nxp.com> |
21 | --- | 21 | --- |
22 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 10 ++++++---- | 22 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 10 ++++++---- |
23 | 1 file changed, 6 insertions(+), 4 deletions(-) | 23 | 1 file changed, 6 insertions(+), 4 deletions(-) |
24 | 24 | ||
25 | 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 |
26 | index XXXXXXX..XXXXXXX 100644 | 26 | index XXXXXXX..XXXXXXX 100644 |
27 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 27 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
28 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 28 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
29 | @@ -XXX,XX +XXX,XX @@ eqos: ethernet@30bf0000 { | 29 | @@ -XXX,XX +XXX,XX @@ eqos: ethernet@30bf0000 { |
30 | }; | 30 | }; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | - aips5: bus@30c00000 { | 33 | - aips5: bus@30c00000 { |
34 | - compatible = "fsl,aips-bus", "simple-bus"; | 34 | - compatible = "fsl,aips-bus", "simple-bus"; |
35 | - reg = <0x30c00000 0x400000>; | 35 | - reg = <0x30c00000 0x400000>; |
36 | + aips5: bus@30df0000 { | 36 | + aips5: bus@30df0000 { |
37 | + compatible = "fsl,imx8mp-aipstz"; | 37 | + compatible = "fsl,imx8mp-aipstz"; |
38 | + reg = <0x30df0000 0x10000>; | 38 | + reg = <0x30df0000 0x10000>; |
39 | + power-domains = <&pgc_audio>; | 39 | + power-domains = <&pgc_audio>; |
40 | #address-cells = <1>; | 40 | #address-cells = <1>; |
41 | #size-cells = <1>; | 41 | #size-cells = <1>; |
42 | - ranges; | 42 | - ranges; |
43 | + #access-controller-cells = <3>; | 43 | + #access-controller-cells = <3>; |
44 | + ranges = <0x30c00000 0x30c00000 0x400000>; | 44 | + ranges = <0x30c00000 0x30c00000 0x400000>; |
45 | 45 | ||
46 | spba-bus@30c00000 { | 46 | spba-bus@30c00000 { |
47 | compatible = "fsl,spba-bus", "simple-bus"; | 47 | compatible = "fsl,spba-bus", "simple-bus"; |
48 | -- | 48 | -- |
49 | 2.34.1 | 49 | 2.34.1 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
3 | Add header file with AIPSTZ-related definitions: consumer types, | 3 | Add header file with AIPSTZ-related definitions: consumer types, |
4 | master/peripheral configuration bits, and master ID definitions. | 4 | master/peripheral configuration bits, and master ID definitions. |
5 | 5 | ||
6 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> | 6 | Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> |
7 | --- | 7 | --- |
8 | arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 39 +++++++++++++++++++ | 8 | arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 33 +++++++++++++++++++ |
9 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 + | 9 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 + |
10 | 2 files changed, 40 insertions(+) | 10 | 2 files changed, 34 insertions(+) |
11 | create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 11 | create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-aipstz.h |
12 | 12 | ||
13 | diff --git a/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h b/arch/arm64/boot/dts/freescale/imx8mp-aipstz.h | 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 | 14 | new file mode 100644 |
15 | index XXXXXXX..XXXXXXX | 15 | index XXXXXXX..XXXXXXX |
... | ... | ||
46 | +#define IMX8MP_AIPSTZ_SDMA2 3 /* AUDIOMIX SDMA2 */ | 46 | +#define IMX8MP_AIPSTZ_SDMA2 3 /* AUDIOMIX SDMA2 */ |
47 | +#define IMX8MP_AIPSTZ_SDMA3 3 /* AUDIOMIX SDMA3 */ | 47 | +#define IMX8MP_AIPSTZ_SDMA3 3 /* AUDIOMIX SDMA3 */ |
48 | +#define IMX8MP_AIPSTZ_HIFI4 5 /* HIFI4 DSP */ | 48 | +#define IMX8MP_AIPSTZ_HIFI4 5 /* HIFI4 DSP */ |
49 | +#define IMX8MP_AIPSTZ_CM7 6 /* Cortex-M7 */ | 49 | +#define IMX8MP_AIPSTZ_CM7 6 /* Cortex-M7 */ |
50 | + | 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 */ | 51 | +#endif /* __IMX8MP_AIPSTZ_H */ |
58 | diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 52 | diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
59 | index XXXXXXX..XXXXXXX 100644 | 53 | index XXXXXXX..XXXXXXX 100644 |
60 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 54 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
61 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 55 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
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 | Reviewed-by: Frank Li <Frank.Li@nxp.com> |
11 | --- | 11 | --- |
12 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 1 + | 12 | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 5 +++++ |
13 | 1 file changed, 1 insertion(+) | 13 | 1 file changed, 5 insertions(+) |
14 | 14 | ||
15 | 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 |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 17 | --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
18 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi | 18 | +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi |
19 | @@ -XXX,XX +XXX,XX @@ dsp: dsp@3b6e8000 { | 19 | @@ -XXX,XX +XXX,XX @@ dsp: dsp@3b6e8000 { |
20 | mboxes = <&mu2 2 0>, <&mu2 2 1>, | 20 | mboxes = <&mu2 2 0>, <&mu2 2 1>, |
21 | <&mu2 3 0>, <&mu2 3 1>; | 21 | <&mu2 3 0>, <&mu2 3 1>; |
22 | memory-region = <&dsp_reserved>; | 22 | memory-region = <&dsp_reserved>; |
23 | + access-controllers = <&aips5 IMX8MP_AIPSTZ_HIFI4_T_RW_PL>; | 23 | + access-controllers = <&aips5 |
24 | + IMX8MP_AIPSTZ_HIFI4 | ||
25 | + IMX8MP_AIPSTZ_MASTER | ||
26 | + (IMX8MP_AIPSTZ_MPL | IMX8MP_AIPSTZ_MTW | IMX8MP_AIPSTZ_MTR) | ||
27 | + >; | ||
24 | status = "disabled"; | 28 | status = "disabled"; |
25 | }; | 29 | }; |
26 | }; | 30 | }; |
27 | -- | 31 | -- |
28 | 2.34.1 | 32 | 2.34.1 | diff view generated by jsdifflib |