2018-12-18 04:53:29

by Nipun Gupta

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: ls1088: add smmu device node

This patch also adds the iommu-map property in fsl-mc node, so
that fsl-mc can use iommu.

Signed-off-by: Nipun Gupta <[email protected]>
---
These patches are based over:
git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git,
as there are couple of changes related to fsl-mc bus in this tree:
https://lore.kernel.org/patchwork/patch/1021020/

arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 92 +++++++++++++++++++++++++-
1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
index de93b42..dec0c2d 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
@@ -576,6 +576,7 @@
reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
<0x00000000 0x08340000 0 0x40000>; /* MC control reg */
msi-parent = <&its>;
+ iommu-map = <0 &smmu 0 0>; /* This is fixed-up by u-boot */
#address-cells = <3>;
#size-cells = <1>;

@@ -641,6 +642,96 @@
};
};
};
+
+ smmu: iommu@5000000 {
+ compatible = "arm,mmu-500";
+ reg = <0 0x5000000 0 0x800000>;
+ #iommu-cells = <1>;
+ stream-match-mask = <0x7C00>;
+ #global-interrupts = <12>;
+ // global secure fault
+ interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+ // combined secure
+ <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+ // global non-secure fault
+ <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+ // combined non-secure
+ <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+ // performance counter interrupts 0-7
+ <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 213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EL_HIGH>,
+ <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
+ };
};

firmware {
@@ -649,5 +740,4 @@
method = "smc";
};
};
-
};
--
1.9.1



2018-12-18 04:53:46

by Nipun Gupta

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: ls1088: add missing dma-coherent property in fsl-mc

Signed-off-by: Nipun Gupta <[email protected]>
---
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
index dec0c2d..b8e31a1 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
@@ -577,6 +577,7 @@
<0x00000000 0x08340000 0 0x40000>; /* MC control reg */
msi-parent = <&its>;
iommu-map = <0 &smmu 0 0>; /* This is fixed-up by u-boot */
+ dma-coherent;
#address-cells = <3>;
#size-cells = <1>;

--
1.9.1


2019-01-11 11:04:24

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: ls1088: add smmu device node

On Tue, Dec 18, 2018 at 04:51:58AM +0000, Nipun Gupta wrote:
> This patch also adds the iommu-map property in fsl-mc node, so
> that fsl-mc can use iommu.
>
> Signed-off-by: Nipun Gupta <[email protected]>
> ---
> These patches are based over:
> git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git,
> as there are couple of changes related to fsl-mc bus in this tree:
> https://lore.kernel.org/patchwork/patch/1021020/
>
> arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 92 +++++++++++++++++++++++++-
> 1 file changed, 91 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> index de93b42..dec0c2d 100644
> --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> @@ -576,6 +576,7 @@
> reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
> <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
> msi-parent = <&its>;
> + iommu-map = <0 &smmu 0 0>; /* This is fixed-up by u-boot */
> #address-cells = <3>;
> #size-cells = <1>;
>
> @@ -641,6 +642,96 @@
> };
> };
> };
> +
> + smmu: iommu@5000000 {

We are trying to keep the nodes with unit-address sorted in the address.
I move the node to where it should be, and applied both patches.

Shawn

> + compatible = "arm,mmu-500";
> + reg = <0 0x5000000 0 0x800000>;
> + #iommu-cells = <1>;
> + stream-match-mask = <0x7C00>;
> + #global-interrupts = <12>;
> + // global secure fault
> + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
> + // combined secure
> + <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
> + // global non-secure fault
> + <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
> + // combined non-secure
> + <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
> + // performance counter interrupts 0-7
> + <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>,
> + // per context interrupt, 64 interrupts
> + <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>,
> +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TYPE_LEVEL_HIGH>,
> + <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
> + };
> };
>
> firmware {
> @@ -649,5 +740,4 @@
> method = "smc";
> };
> };
> -
> };
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2019-01-11 11:04:53

by Nipun Gupta

[permalink] [raw]
Subject: RE: [PATCH 1/2] arm64: dts: ls1088: add smmu device node



> -----Original Message-----
> From: Shawn Guo [mailto:[email protected]]
> Sent: Friday, January 11, 2019 2:10 PM
> To: Nipun Gupta <[email protected]>
> Cc: Leo Li <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH 1/2] arm64: dts: ls1088: add smmu device node
>
> On Tue, Dec 18, 2018 at 04:51:58AM +0000, Nipun Gupta wrote:
> > This patch also adds the iommu-map property in fsl-mc node, so
> > that fsl-mc can use iommu.
> >
> > Signed-off-by: Nipun Gupta <[email protected]>
> > ---
> > These patches are based over:
> > git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git,
> > as there are couple of changes related to fsl-mc bus in this tree:
> >
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flor
> e.kernel.org%2Fpatchwork%2Fpatch%2F1021020%2F&amp;data=02%7C01%
> 7Cnipun.gupta%40nxp.com%7C32db0a82c058487b3b9b08d677a0686c%7C686
> ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636827928177177279&amp;s
> data=owEtCHfG%2Bc4pjO5lkb0TODYs6xORn2jXgLv4qJ95u8o%3D&amp;reser
> ved=0
> >
> > arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 92
> +++++++++++++++++++++++++-
> > 1 file changed, 91 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> > index de93b42..dec0c2d 100644
> > --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
> > @@ -576,6 +576,7 @@
> > reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal
> base */
> > <0x00000000 0x08340000 0 0x40000>; /* MC
> control reg */
> > msi-parent = <&its>;
> > + iommu-map = <0 &smmu 0 0>; /* This is fixed-up by
> u-boot */
> > #address-cells = <3>;
> > #size-cells = <1>;
> >
> > @@ -641,6 +642,96 @@
> > };
> > };
> > };
> > +
> > + smmu: iommu@5000000 {
>
> We are trying to keep the nodes with unit-address sorted in the address.
> I move the node to where it should be, and applied both patches.

Thank you.