[RESEND,3/6] ARM: dts: imx7s: add CAAM device node

Message ID 1516805435-15034-4-git-send-email-pure.logic@nexus-software.ie
State New
Headers show
Series
  • Untitled series #8364
Related show

Commit Message

Bryan O'Donoghue Jan. 24, 2018, 2:50 p.m.
From: Rui Miguel Silva <rui.silva@linaro.org>


Add CAAM device node to the i.MX7s device tree.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>

Cc: "Horia Geantă" <horia.geanta@nxp.com>
Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>

---
 arch/arm/boot/dts/imx7s.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

-- 
2.7.4

Comments

Auer, Lukas Jan. 24, 2018, 6:12 p.m. | #1
On Wed, 2018-01-24 at 14:50 +0000, Bryan O'Donoghue wrote:
> From: Rui Miguel Silva <rui.silva@linaro.org>

> 

> Add CAAM device node to the i.MX7s device tree.

> 

> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>

> Cc: "Horia Geantă" <horia.geanta@nxp.com>

> Cc: Aymen Sghaier <aymen.sghaier@nxp.com>

> Cc: Fabio Estevam <fabio.estevam@nxp.com>

> Cc: Peng Fan <peng.fan@nxp.com>

> Cc: Herbert Xu <herbert@gondor.apana.org.au>

> Cc: "David S. Miller" <davem@davemloft.net>

> Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>

> Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>

> ---

>  arch/arm/boot/dts/imx7s.dtsi | 26 ++++++++++++++++++++++++++

>  1 file changed, 26 insertions(+)

> 

> diff --git a/arch/arm/boot/dts/imx7s.dtsi

> b/arch/arm/boot/dts/imx7s.dtsi

> index 82ad26e..0da146e 100644

> --- a/arch/arm/boot/dts/imx7s.dtsi

> +++ b/arch/arm/boot/dts/imx7s.dtsi

> @@ -805,6 +805,32 @@

>  				status = "disabled";

>  			};

>  

> +			crypto: caam@30900000 {

> +				compatible = "fsl,sec-v4.0";

> +				fsl,sec-era = <4>;

> +				#address-cells = <1>;

> +				#size-cells = <1>;

> +				reg = <0x30900000 0x10000>;

> +				ranges = <0 0x30900000 0x10000>;

> +				clocks = <&clks IMX7D_CAAM_MEM_CLK>,

> +					 <&clks

> IMX7D_CAAM_ACLK_CLK>,

> +					 <&clks IMX7D_CAAM_IPG_CLK>,

> +					 <&clks IMX7D_EIM_ROOT_CLK>;

> +				clock-names = "mem", "aclk", "ipg",

> "emi_slow";

> +

> +				sec_jr0: jr0@1000 {

> +					compatible = "fsl,sec-v4.0-

> job-ring";

> +					reg = <0x1000 0x1000>;

> +					interrupts = <GIC_SPI 105

> IRQ_TYPE_LEVEL_HIGH>;

> +				};

> +

> +				sec_jr1: jr1@2000 {

> +					compatible = "fsl,sec-v4.0-

> job-ring";

> +					reg = <0x2000 0x1000>;

> +					interrupts = <GIC_SPI 106

> IRQ_TYPE_LEVEL_HIGH>;

> +				};

> +			};

> +

>  			flexcan1: can@30a00000 {

>  				compatible = "fsl,imx7d-flexcan",

> "fsl,imx6q-flexcan";

>  				reg = <0x30a00000 0x10000>;


Looking at the device tree from the NXP kernel [1], the job ring and
clock configurations should be slightly different.

The job ring configuration has one additional job ring at offset 3000
and interrupt 114.

The clock configuration has changed to just one CAAM-specific clock in
addition to the ahb clock. This also means that additional
modifications to the CAAM driver are necessary or it will complain that
it doesn't find all clocks. 

Thanks,
Lukas


[1] https://github.com/Freescale/linux-fslc/blob/4.1-2.0.x-imx/arch/arm
/boot/dts/imx7d.dtsi
Bryan O'Donoghue Jan. 24, 2018, 10:56 p.m. | #2
On 24/01/18 22:48, Bryan O'Donoghue wrote:
>> The clock configuration has changed to just one CAAM-specific clock in

>> addition to the ahb clock. This also means that additional

>> modifications to the CAAM driver are necessary or it will complain that

>> it doesn't find all clocks.

> 

> Sure - but, those clock changes aren't merged to upstream just yet, so 

> we won't those changes to this DTS addition yet.

> 

> Thanks for the review.

> 

> ---

> bod


Ah Rui has pointed out to me for i.mx7 there are two clocks on on i.mx6 
there are four clocks.

The bit that confused me there was the clock names on the 4.1 tree you 
pointed to was clock-names = "caam_ipg", "caam_aclk"; and for 4.15 those 
should be "ipg" and "aclk" by the looks of it.

So yes.

We will add the second job-ring and subtract the two extraneous clocks.

---
bod
kbuild test robot Jan. 27, 2018, 3:49 p.m. | #3
Hi Rui,

I love your patch! Yet something to improve:

[auto build test ERROR on crypto/master]
[also build test ERROR on v4.15-rc9 next-20180126]
[cannot apply to cryptodev/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/Enable-CAAM-on-i-MX7s-fix-TrustZone-issues/20180127-185422
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git master
config: arm-u8500_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

Note: the linux-review/Bryan-O-Donoghue/Enable-CAAM-on-i-MX7s-fix-TrustZone-issues/20180127-185422 HEAD f907a172373d2c61dd7bf25a88621abc6e410f15 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/imx7s.dtsi:815.21-22 syntax error

   FATAL ERROR: Unable to parse input tree

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Rui Miguel Silva Jan. 28, 2018, 3:42 p.m. | #4
Hi,
Thanks for the report.
On Sat 27 Jan 2018 at 15:49, kbuild test robot wrote:
> Hi Rui,

>

> I love your patch! Yet something to improve:

>

> [auto build test ERROR on crypto/master]

> [also build test ERROR on v4.15-rc9 next-20180126]

> [cannot apply to cryptodev/master]

> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

>

> url:    https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/Enable-CAAM-on-i-MX7s-fix-TrustZone-issues/20180127-185422

> base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git master

> config: arm-u8500_defconfig (attached as .config)

> compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0

> reproduce:

>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross

>         chmod +x ~/bin/make.cross

>         # save the attached .config to linux build tree

>         make.cross ARCH=arm 

>

> Note: the linux-review/Bryan-O-Donoghue/Enable-CAAM-on-i-MX7s-fix-TrustZone-issues/20180127-185422 HEAD f907a172373d2c61dd7bf25a88621abc6e410f15 builds fine.

>       It only hurts bisectibility.


Yeah, the order of the patches in the series were wrong and break
bisectibility.

V2 of this series already sent, besides other fixes, also fix this.
Once again many thanks.

---
Cheers,
	Rui

Patch

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 82ad26e..0da146e 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -805,6 +805,32 @@ 
 				status = "disabled";
 			};
 
+			crypto: caam@30900000 {
+				compatible = "fsl,sec-v4.0";
+				fsl,sec-era = <4>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				reg = <0x30900000 0x10000>;
+				ranges = <0 0x30900000 0x10000>;
+				clocks = <&clks IMX7D_CAAM_MEM_CLK>,
+					 <&clks IMX7D_CAAM_ACLK_CLK>,
+					 <&clks IMX7D_CAAM_IPG_CLK>,
+					 <&clks IMX7D_EIM_ROOT_CLK>;
+				clock-names = "mem", "aclk", "ipg", "emi_slow";
+
+				sec_jr0: jr0@1000 {
+					compatible = "fsl,sec-v4.0-job-ring";
+					reg = <0x1000 0x1000>;
+					interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+				};
+
+				sec_jr1: jr1@2000 {
+					compatible = "fsl,sec-v4.0-job-ring";
+					reg = <0x2000 0x1000>;
+					interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+				};
+			};
+
 			flexcan1: can@30a00000 {
 				compatible = "fsl,imx7d-flexcan", "fsl,imx6q-flexcan";
 				reg = <0x30a00000 0x10000>;