Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664641 > unrolled thread

[PATCHv2 0/5] OMAP4: crypto support

Started bySebastian Reichel <sebastian.reichel@collabora.co.uk>
First post2017-06-13 11:30 +0200
Last post2017-06-14 10:00 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCHv2 0/5] OMAP4: crypto support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-13 11:30 +0200
    [RFCv2 4/5] ARM: OMAP4: hwmod data: add aes2 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-13 11:30 +0200
    [PATCHv2 1/5] ARM: dts: omap4: Fix aes entry Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-13 11:30 +0200
    Re: [PATCHv2 0/5] OMAP4: crypto support Tero Kristo <t-kristo@ti.com> - 2017-06-13 16:00 +0200
      Re: [PATCHv2 0/5] OMAP4: crypto support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-13 16:30 +0200
        Re: [PATCHv2 0/5] OMAP4: crypto support Tero Kristo <t-kristo@ti.com> - 2017-06-13 16:50 +0200
          Re: [PATCHv2 0/5] OMAP4: crypto support Tony Lindgren <tony@atomide.com> - 2017-06-14 10:00 +0200

#1664641 — [PATCHv2 0/5] OMAP4: crypto support

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-06-13 11:30 +0200
Subject[PATCHv2 0/5] OMAP4: crypto support
Message-ID<tRQj7-6bD-15@gated-at.bofh.it>
Hi,

This adds crypto support for OMAP4, which was missing for some reason.
This fixes error about missing hwmod on Droid 4. IP-Cores for AES and
DES are working according to selftest.

Changes since PATCHv1:
 * remove patch adding des_fck to DT
 * add patch removing aes[12]_fck from DT
 * add patch renaming hwmod aes to aes1 in DT
 * update hwmod patches according to feedback from Tero
 * add patch for aes2 hwmod

-- Sebastian

Sebastian Reichel (5):
  ARM: dts: omap4: Fix aes entry
  ARM: dts: omap4.dtsi: remove aes[12]_fck
  ARM: OMAP4: hwmod data: add aes1
  ARM: OMAP4: hwmod data: add aes2
  ARM: OMAP4: hwmod data: add des

 arch/arm/boot/dts/omap4.dtsi               |   4 +-
 arch/arm/boot/dts/omap44xx-clocks.dtsi     |  16 -----
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 100 +++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+), 18 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1664643 — [RFCv2 4/5] ARM: OMAP4: hwmod data: add aes2

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-06-13 11:30 +0200
Subject[RFCv2 4/5] ARM: OMAP4: hwmod data: add aes2
Message-ID<tRQj8-6bD-37@gated-at.bofh.it>
In reply to#1664641
This adds the hwmod entry for the second AES module
available on OMAP4.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
Hi,

This module is currently missing from DT and the public TRM does not provide
enough information for me to add it (the memory area for the crypto cores is
"reserved"). Adding it without the DT entry results in the following error
during boot:

[    0.456085] omap_hwmod: aes2: no dt node
[    0.460205] ------------[ cut here ]------------
[    0.464996] WARNING: CPU: 0 PID: 1 at arch/arm/mach-omap2/omap_hwmod.c:2359 _init.constprop.19+0x1e4/0x4cc
[    0.475036] omap_hwmod: aes2: doesn't have mpu register target base
[    0.481536] Modules linked in:
[    0.484710] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc4-00030-gcc9206ecc9d9-dirty #421
[    0.493743] Hardware name: Generic OMAP4 (Flattened Device Tree)
[    0.499969] [<c0110260>] (unwind_backtrace) from [<c010c2dc>] (show_stack+0x10/0x14)
[    0.507995] [<c010c2dc>] (show_stack) from [<c04d20e4>] (dump_stack+0xac/0xe0)
[    0.515502] [<c04d20e4>] (dump_stack) from [<c013ab48>] (__warn+0xd8/0x104)
[    0.522735] [<c013ab48>] (__warn) from [<c013aba8>] (warn_slowpath_fmt+0x34/0x44)
[    0.530487] [<c013aba8>] (warn_slowpath_fmt) from [<c0f0cfdc>] (_init.constprop.19+0x1e4/0x4cc)
[    0.539489] [<c0f0cfdc>] (_init.constprop.19) from [<c0f0d7c8>] (__omap_hwmod_setup_all+0x3c/0x100)
[    0.548889] [<c0f0d7c8>] (__omap_hwmod_setup_all) from [<c0101874>] (do_one_initcall+0x3c/0x170)
[    0.557983] [<c0101874>] (do_one_initcall) from [<c0f00eb4>] (kernel_init_freeable+0x210/0x2dc)
[    0.567016] [<c0f00eb4>] (kernel_init_freeable) from [<c0ad6a34>] (kernel_init+0x8/0x114)
[    0.575500] [<c0ad6a34>] (kernel_init) from [<c01077d0>] (ret_from_fork+0x14/0x24)
[    0.583374] ---[ end trace 7e68b72794b10f28 ]---

-- Sebastian

---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 0aff064d6469..3d58eaef387e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -992,6 +992,27 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__aes1 = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+static struct omap_hwmod omap44xx_aes2_hwmod = {
+	.name		= "aes2",
+	.class		= &omap44xx_aes_hwmod_class,
+	.clkdm_name	= "l4_secure_clkdm",
+	.main_clk	= "l3_div_ck",
+	.prcm		= {
+		.omap4	= {
+			.context_offs	= OMAP4_RM_L4SEC_AES2_CONTEXT_OFFSET,
+			.clkctrl_offs	= OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET,
+			.modulemode	= MODULEMODE_SWCTRL,
+		},
+	},
+};
+
+static struct omap_hwmod_ocp_if omap44xx_l3_main_2__aes2 = {
+	.master		= &omap44xx_l4_per_hwmod,
+	.slave		= &omap44xx_aes2_hwmod,
+	.clk		= "l3_div_ck",
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 /*
  * 'fdif' class
  * face detection hw accelerator module
@@ -4834,6 +4855,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
 	&omap44xx_mpu__emif1,
 	&omap44xx_mpu__emif2,
 	&omap44xx_l3_main_2__aes1,
+	&omap44xx_l3_main_2__aes2,
 	NULL,
 };
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1664644 — [PATCHv2 1/5] ARM: dts: omap4: Fix aes entry

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-06-13 11:30 +0200
Subject[PATCHv2 1/5] ARM: dts: omap4: Fix aes entry
Message-ID<tRQj9-6bD-41@gated-at.bofh.it>
In reply to#1664641
OMAP4 has a second aes module, so let's use proper name for
the first instance.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 arch/arm/boot/dts/omap4.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 578c53f08309..589690e034d3 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -900,9 +900,9 @@
 			ctrl-module = <&omap_control_usbotg>;
 		};
 
-		aes: aes@4b501000 {
+		aes1: aes@4b501000 {
 			compatible = "ti,omap4-aes";
-			ti,hwmods = "aes";
+			ti,hwmods = "aes1";
 			reg = <0x4b501000 0xa0>;
 			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
 			dmas = <&sdma 111>, <&sdma 110>;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1664879

FromTero Kristo <t-kristo@ti.com>
Date2017-06-13 16:00 +0200
Message-ID<tRUwp-dH-7@gated-at.bofh.it>
In reply to#1664641
On 13/06/17 12:28, Sebastian Reichel wrote:
> Hi,
> 
> This adds crypto support for OMAP4, which was missing for some reason.
> This fixes error about missing hwmod on Droid 4. IP-Cores for AES and
> DES are working according to selftest.
> 
> Changes since PATCHv1:
>   * remove patch adding des_fck to DT
>   * add patch removing aes[12]_fck from DT
>   * add patch renaming hwmod aes to aes1 in DT
>   * update hwmod patches according to feedback from Tero
>   * add patch for aes2 hwmod
> 
> -- Sebastian

I just posted a few extra patches on top of this series, for adding the 
missing dts data for aes2 and adding sham accelerator also. The dts data 
should be applied first if you want to avoid any issues with hwmod core 
complaining about missing DT data, so the sequencing of this series and 
mine need to be done carefully.

The patches themselves in this series look fine now, so:

Acked-by: Tero Kristo <t-kristo@ti.com>

> 
> Sebastian Reichel (5):
>    ARM: dts: omap4: Fix aes entry
>    ARM: dts: omap4.dtsi: remove aes[12]_fck
>    ARM: OMAP4: hwmod data: add aes1
>    ARM: OMAP4: hwmod data: add aes2
>    ARM: OMAP4: hwmod data: add des
> 
>   arch/arm/boot/dts/omap4.dtsi               |   4 +-
>   arch/arm/boot/dts/omap44xx-clocks.dtsi     |  16 -----
>   arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 100 +++++++++++++++++++++++++++++
>   3 files changed, 102 insertions(+), 18 deletions(-)
> 

[toc] | [prev] | [next] | [standalone]


#1664922

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-06-13 16:30 +0200
Message-ID<tRUZr-Cj-3@gated-at.bofh.it>
In reply to#1664879

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Tue, Jun 13, 2017 at 04:49:18PM +0300, Tero Kristo wrote:
> On 13/06/17 12:28, Sebastian Reichel wrote:
> > This adds crypto support for OMAP4, which was missing for some reason.
> > This fixes error about missing hwmod on Droid 4. IP-Cores for AES and
> > DES are working according to selftest.
> > 
> > Changes since PATCHv1:
> >   * remove patch adding des_fck to DT
> >   * add patch removing aes[12]_fck from DT
> >   * add patch renaming hwmod aes to aes1 in DT
> >   * update hwmod patches according to feedback from Tero
> >   * add patch for aes2 hwmod
> > 
> > -- Sebastian
> 
> I just posted a few extra patches on top of this series, for adding
> the missing dts data for aes2 and adding sham accelerator also.

Thanks :)

> The dts data should be applied first if you want to avoid any
> issues with hwmod core complaining about missing DT data, so the
> sequencing of this series and mine need to be done carefully.

There is also a warning printed if DT references a missing hwmod
entry (that's how I noticed this in the first place). It's less
noisy, though. Since kernel builds and boots with any order and
crypto hardware does not work at the moment there is no real
problem with bisect. I suggest to merge the DTS patches normally
through the separate dt branch.

> The patches themselves in this series look fine now, so:
> 
> Acked-by: Tero Kristo <t-kristo@ti.com>

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1664943

FromTero Kristo <t-kristo@ti.com>
Date2017-06-13 16:50 +0200
Message-ID<tRViO-Jw-25@gated-at.bofh.it>
In reply to#1664922
On 13/06/17 17:24, Sebastian Reichel wrote:
> Hi,
> 
> On Tue, Jun 13, 2017 at 04:49:18PM +0300, Tero Kristo wrote:
>> On 13/06/17 12:28, Sebastian Reichel wrote:
>>> This adds crypto support for OMAP4, which was missing for some reason.
>>> This fixes error about missing hwmod on Droid 4. IP-Cores for AES and
>>> DES are working according to selftest.
>>>
>>> Changes since PATCHv1:
>>>    * remove patch adding des_fck to DT
>>>    * add patch removing aes[12]_fck from DT
>>>    * add patch renaming hwmod aes to aes1 in DT
>>>    * update hwmod patches according to feedback from Tero
>>>    * add patch for aes2 hwmod
>>>
>>> -- Sebastian
>>
>> I just posted a few extra patches on top of this series, for adding
>> the missing dts data for aes2 and adding sham accelerator also.
> 
> Thanks :)
> 
>> The dts data should be applied first if you want to avoid any
>> issues with hwmod core complaining about missing DT data, so the
>> sequencing of this series and mine need to be done carefully.
> 
> There is also a warning printed if DT references a missing hwmod
> entry (that's how I noticed this in the first place). It's less
> noisy, though. Since kernel builds and boots with any order and
> crypto hardware does not work at the moment there is no real
> problem with bisect. I suggest to merge the DTS patches normally
> through the separate dt branch.

Yeah thats actually true also. Up to Tony to decide how he wants to 
handle these. The huge warning is mainly an annoyance.

-Tero

[toc] | [prev] | [next] | [standalone]


#1665539

FromTony Lindgren <tony@atomide.com>
Date2017-06-14 10:00 +0200
Message-ID<tSbnA-2oc-13@gated-at.bofh.it>
In reply to#1664943
* Tero Kristo <t-kristo@ti.com> [170613 07:46]:
> On 13/06/17 17:24, Sebastian Reichel wrote:
> > Hi,
> > 
> > On Tue, Jun 13, 2017 at 04:49:18PM +0300, Tero Kristo wrote:
> > > On 13/06/17 12:28, Sebastian Reichel wrote:
> > > > This adds crypto support for OMAP4, which was missing for some reason.
> > > > This fixes error about missing hwmod on Droid 4. IP-Cores for AES and
> > > > DES are working according to selftest.
> > > > 
> > > > Changes since PATCHv1:
> > > >    * remove patch adding des_fck to DT
> > > >    * add patch removing aes[12]_fck from DT
> > > >    * add patch renaming hwmod aes to aes1 in DT
> > > >    * update hwmod patches according to feedback from Tero
> > > >    * add patch for aes2 hwmod
> > > > 
> > > > -- Sebastian
> > > 
> > > I just posted a few extra patches on top of this series, for adding
> > > the missing dts data for aes2 and adding sham accelerator also.
> > 
> > Thanks :)
> > 
> > > The dts data should be applied first if you want to avoid any
> > > issues with hwmod core complaining about missing DT data, so the
> > > sequencing of this series and mine need to be done carefully.
> > 
> > There is also a warning printed if DT references a missing hwmod
> > entry (that's how I noticed this in the first place). It's less
> > noisy, though. Since kernel builds and boots with any order and
> > crypto hardware does not work at the moment there is no real
> > problem with bisect. I suggest to merge the DTS patches normally
> > through the separate dt branch.
> 
> Yeah thats actually true also. Up to Tony to decide how he wants to handle
> these. The huge warning is mainly an annoyance.

Applying patches from both Sebastian's and Tero's sets into
split into omap-for-v4.13/dt and omap-for-v4.13/soc-v4 branches.

Thanks,

Tony

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web