2013-05-16 11:27:37

by Lee Jones

[permalink] [raw]
Subject: [PATCH 0/6] crypto: ux500/[cryp|hash] - Enable Device Tree

This patch-set simply allows ux500-[cryp|hash] drivers to be probed
when Snowball is running with Device Tree enabled.

Linus,

Feel free to split the DTS changes out into your ux500-devicetree branch.

arch/arm/boot/dts/dbx5x0.dtsi | 17 +++++++++++++++++
arch/arm/boot/dts/snowball.dts | 8 ++++++++
arch/arm/mach-ux500/cpu-db8500.c | 2 ++
drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++
drivers/crypto/ux500/hash/hash_core.c | 6 ++++++
5 files changed, 39 insertions(+)


2013-05-16 11:27:40

by Lee Jones

[permalink] [raw]
Subject: [PATCH 1/6] ARM: ux500: Add Device Tree nodes for the ux500 Crypt device

This patch provides information required to setup ux500-crypt when
booting with DT on the Snowball low-cost development platform.

Signed-off-by: Lee Jones <[email protected]>
---
arch/arm/boot/dts/dbx5x0.dtsi | 9 +++++++++
arch/arm/boot/dts/snowball.dts | 4 ++++
2 files changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index fd5794a..92fd4b74 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -755,5 +755,14 @@

status = "disabled";
};
+
+ cryp@a03cb000 {
+ compatible = "stericsson,ux500-cryp";
+ reg = <0xa03cb000 0x1000>;
+ interrupts = <0 15 0x4>;
+
+ v-ape-supply = <&db8500_vape_reg>;
+ status = "disabled";
+ };
};
};
diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index db5db24..de585fd 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -350,5 +350,9 @@
};
};
};
+
+ cryp@a03cb000 {
+ status = "okay";
+ };
};
};
--
1.7.10.4

2013-05-16 11:27:46

by Lee Jones

[permalink] [raw]
Subject: [PATCH 3/6] ARM: ux500: Provide an AUXDATA entry for ux500-cyrpt

This provides a device name which is required by the common clk API.

Signed-off-by: Lee Jones <[email protected]>
---
arch/arm/mach-ux500/cpu-db8500.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 3b77e36..4d118d8 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -246,6 +246,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu",
&db8500_prcmu_pdata),
OF_DEV_AUXDATA("smsc,lan9115", 0x50000000, "smsc911x.0", NULL),
+ OF_DEV_AUXDATA("stericsson,ux500-cryp", 0xa03cb000, "cryp1", NULL),
/* Requires device name bindings. */
OF_DEV_AUXDATA("stericsson,nmk-pinctrl", U8500_PRCMU_BASE,
"pinctrl-db8500", NULL),
--
1.7.10.4

2013-05-16 11:27:53

by Lee Jones

[permalink] [raw]
Subject: [PATCH 6/6] crypto: ux500/hash - Enable DT probing of the driver

By providing an OF match table with a suitable compatible string, we
can ensure the ux500-hasht driver is probed by supplying an associated
DT node in a given platform's Device Tree.

Cc: Herbert Xu <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/crypto/ux500/hash/hash_core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 9ca6fbb..f89fe8a 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -1981,6 +1981,11 @@ static int ux500_hash_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(ux500_hash_pm, ux500_hash_suspend, ux500_hash_resume);

+static const struct of_device_id ux500_hash_match[] = {
+ { .compatible = "stericsson,ux500-hash" },
+ { },
+};
+
static struct platform_driver hash_driver = {
.probe = ux500_hash_probe,
.remove = ux500_hash_remove,
@@ -1988,6 +1993,7 @@ static struct platform_driver hash_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "hash1",
+ .of_match_table = ux500_hash_match,
.pm = &ux500_hash_pm,
}
};
--
1.7.10.4

2013-05-16 11:27:56

by Lee Jones

[permalink] [raw]
Subject: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

By providing an OF match table with a suitable compatible string, we
can ensure the ux500-crypt driver is probed by supplying an associated
DT node in a given platform's Device Tree.

Cc: Herbert Xu <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c
index 4f8b11a..d3940b7 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -1772,6 +1772,11 @@ static int ux500_cryp_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume);

+static const struct of_device_id ux500_cryp_match[] = {
+ { .compatible = "stericsson,ux500-cryp" },
+ { },
+};
+
static struct platform_driver cryp_driver = {
.probe = ux500_cryp_probe,
.remove = ux500_cryp_remove,
@@ -1779,6 +1784,7 @@ static struct platform_driver cryp_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "cryp1",
+ .of_match_table = ux500_cryp_match,
.pm = &ux500_cryp_pm,
}
};
--
1.7.10.4

2013-05-16 11:28:29

by Lee Jones

[permalink] [raw]
Subject: [PATCH 4/6] ARM: ux500: Provide an AUXDATA entry for ux500-hash

This provides a device name which is required by the common clk API.

Signed-off-by: Lee Jones <[email protected]>
---
arch/arm/mach-ux500/cpu-db8500.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 4d118d8..8305bad 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -247,6 +247,7 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
&db8500_prcmu_pdata),
OF_DEV_AUXDATA("smsc,lan9115", 0x50000000, "smsc911x.0", NULL),
OF_DEV_AUXDATA("stericsson,ux500-cryp", 0xa03cb000, "cryp1", NULL),
+ OF_DEV_AUXDATA("stericsson,ux500-hash", 0xa03c2000, "hash1", NULL),
/* Requires device name bindings. */
OF_DEV_AUXDATA("stericsson,nmk-pinctrl", U8500_PRCMU_BASE,
"pinctrl-db8500", NULL),
--
1.7.10.4

2013-05-16 11:27:42

by Lee Jones

[permalink] [raw]
Subject: [PATCH 2/6] ARM: ux500: Add Device Tree nodes for the ux500 Hash device

This patch provides information required to setup ux500-hash when
booting with DT on the Snowball low-cost development platform.

Signed-off-by: Lee Jones <[email protected]>
---
arch/arm/boot/dts/dbx5x0.dtsi | 8 ++++++++
arch/arm/boot/dts/snowball.dts | 4 ++++
2 files changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 92fd4b74..6c25fbe 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -764,5 +764,13 @@
v-ape-supply = <&db8500_vape_reg>;
status = "disabled";
};
+
+ hash@a03c2000 {
+ compatible = "stericsson,ux500-hash";
+ reg = <0xa03c2000 0x1000>;
+
+ v-ape-supply = <&db8500_vape_reg>;
+ status = "disabled";
+ };
};
};
diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index de585fd..3cadb5b 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -354,5 +354,9 @@
cryp@a03cb000 {
status = "okay";
};
+
+ hash@a03c2000 {
+ status = "okay";
+ };
};
};
--
1.7.10.4

2013-05-24 06:20:40

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:

> By providing an OF match table with a suitable compatible string, we
> can ensure the ux500-crypt driver is probed by supplying an associated
> DT node in a given platform's Device Tree.
>
> Cc: Herbert Xu <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Herbert, can I have your ACK on patch 5 & 6 in this series to take it
through the ARM SoC tree?

Yours,
Linus Walleij

2013-05-24 06:21:39

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

On Fri, May 24, 2013 at 08:20:38AM +0200, Linus Walleij wrote:
> On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:
>
> > By providing an OF match table with a suitable compatible string, we
> > can ensure the ux500-crypt driver is probed by supplying an associated
> > DT node in a given platform's Device Tree.
> >
> > Cc: Herbert Xu <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
>
> Herbert, can I have your ACK on patch 5 & 6 in this series to take it
> through the ARM SoC tree?

Sure,

Acked-by: Herbert Xu <[email protected]>

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2013-05-24 06:26:06

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:

> By providing an OF match table with a suitable compatible string, we
> can ensure the ux500-crypt driver is probed by supplying an associated
> DT node in a given platform's Device Tree.
>
> Cc: Herbert Xu <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++

W00t! No binding document?

OK I guess it's just reg, irq ... but still it's compulsory,
right?

Yours,
Linus Walleij

2013-05-24 06:27:53

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/6] crypto: ux500/[cryp|hash] - Enable Device Tree

On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:

> This patch-set simply allows ux500-[cryp|hash] drivers to be probed
> when Snowball is running with Device Tree enabled.
>
> Linus,
>
> Feel free to split the DTS changes out into your ux500-devicetree branch.

I have tentatively applied 1, 2, 3 & 4 to my device tree branch.

5 & 6 need bindings and ACKs.

I can merge them through the ux500 devicetree branch as well I
think, they "should" be orthogonal to other (DMA-related) changes
AFAICT.

Yours,
Linus Walleij

2013-05-24 08:32:52

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

On Fri, 24 May 2013, Linus Walleij wrote:

> On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:
>
> > By providing an OF match table with a suitable compatible string, we
> > can ensure the ux500-crypt driver is probed by supplying an associated
> > DT node in a given platform's Device Tree.
> >
> > Cc: Herbert Xu <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
>
> Herbert, can I have your ACK on patch 5 & 6 in this series to take it
> through the ARM SoC tree?

Right, there are no bindings, so they don't need a document.

--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2013-05-24 11:16:46

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 5/6] crypto: ux500/cryp - Enable DT probing of the driver

On Fri, May 24, 2013 at 10:32 AM, Lee Jones <[email protected]> wrote:
> On Fri, 24 May 2013, Linus Walleij wrote:
>> On Thu, May 16, 2013 at 1:27 PM, Lee Jones <[email protected]> wrote:
>>
>> > By providing an OF match table with a suitable compatible string, we
>> > can ensure the ux500-crypt driver is probed by supplying an associated
>> > DT node in a given platform's Device Tree.
>> >
>> > Cc: Herbert Xu <[email protected]>
>> > Cc: [email protected]
>> > Signed-off-by: Lee Jones <[email protected]>
>>
>> Herbert, can I have your ACK on patch 5 & 6 in this series to take it
>> through the ARM SoC tree?
>
> Right, there are no bindings, so they don't need a document.

Surely the requirement that the node must have <reg>,
<irqs> and <regulator> for the driver to even probe is a
binding?

The fact that the drivers/of/* core on Linux will auto-populate
platform devices with those properties is a pure Linux
pecularity, and the bindings are there for OS independence.

Whether we need to document it for such standard things
is another thing, hopefully Rob or someone can answer that?

Yours,
Linus Walleij