2013-08-08 13:30:26

by Lothar Waßmann

[permalink] [raw]
Subject: [PATCH 0/3] ARM: dts: mxs: dcp cleanup patches

This patch series does the following:

- let the driver be "disabled" by default in imx28.dtsi
- coding style cleanups in drivers/crypto/dcp.c
- use the "official" 'fsl,' prefix in the 'compatible' property

The last patch adds a new entry to the of_match_table of the driver,
so that current DT blobs will still work. When out of tree users
(mentioned in the commit log of 519d8b1a "Added support for
Freescale's DCP co-processor") have updated their DTBs the old entry
'fsl-dsp' can be removed from the driver.

This patch series requires at least
"[PATCH 2/8] ARM: dts: mxs: add labels to most nodes for easier reference"
from the patch series:
<[email protected]> to be
applied.

arch/arm/boot/dts/imx28.dtsi | 2 +-
b/arch/arm/boot/dts/imx28-evk.dts | 4 ++++
b/arch/arm/boot/dts/imx28.dtsi | 3 ++-
b/drivers/crypto/dcp.c | 11 +++++------
drivers/crypto/dcp.c | 2 ++
5 files changed, 14 insertions(+), 8 deletions(-)


2013-08-08 13:30:29

by Lothar Waßmann

[permalink] [raw]
Subject: [PATCH 3/3] crypto: dcp: rename 'compatible' property to 'fsl,dcp'

Leave the old 'fsl-dcp' value in place with an appropriate comment
until external users have updated their DTBs.

Signed-off-by: Lothar Waßmann <[email protected]>
---
arch/arm/boot/dts/imx28.dtsi | 2 +-
drivers/crypto/dcp.c | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index ea99d09..0584935 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -794,7 +794,7 @@
};

dcp: dcp@80028000 {
- compatible = "fsl-dcp";
+ compatible = "fsl,dcp";
reg = <0x80028000 0x2000>;
interrupts = <52 53 54>;
status = "disabled";
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c
index 6a2495e..72196c0 100644
--- a/drivers/crypto/dcp.c
+++ b/drivers/crypto/dcp.c
@@ -889,6 +889,8 @@ static int dcp_remove(struct platform_device *pdev)
}

static struct of_device_id fs_dcp_of_match[] = {
+ { .compatible = "fsl,dcp", },
+ /* To be removed when the DT blobs referencing this have been updated */
{ .compatible = "fsl-dcp", },
{}
};
--
1.7.2.5


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2013-08-08 13:30:28

by Lothar Waßmann

[permalink] [raw]
Subject: [PATCH 2/3] crypto: dcp - cleanup: commas at end of struct initializers where appropriate


Signed-off-by: Lothar Waßmann <[email protected]>
---
drivers/crypto/dcp.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c
index a8a7dd4..6a2495e 100644
--- a/drivers/crypto/dcp.c
+++ b/drivers/crypto/dcp.c
@@ -651,8 +651,7 @@ static struct crypto_alg algs[] = {
.encrypt = dcp_aes_cbc_encrypt,
.decrypt = dcp_aes_cbc_decrypt,
.ivsize = AES_KEYSIZE_128,
- }
-
+ },
},
};

@@ -890,8 +889,8 @@ static int dcp_remove(struct platform_device *pdev)
}

static struct of_device_id fs_dcp_of_match[] = {
- { .compatible = "fsl-dcp"},
- {},
+ { .compatible = "fsl-dcp", },
+ {}
};

static struct platform_driver fs_dcp_driver = {
@@ -900,8 +899,8 @@ static struct platform_driver fs_dcp_driver = {
.driver = {
.name = "fsl-dcp",
.owner = THIS_MODULE,
- .of_match_table = fs_dcp_of_match
- }
+ .of_match_table = fs_dcp_of_match,
+ },
};

module_platform_driver(fs_dcp_driver);
--
1.7.2.5


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2013-08-08 13:30:27

by Lothar Waßmann

[permalink] [raw]
Subject: [PATCH 1/3] ARM: dts: mxs: set dcp to "disabled" by default

Reintroduce 'status = "disabled"' for the dcp node that was dropped by
commit 519d8b1a "Added support for Freescale's DCP co-processor".

Explicitly enable it in imx28-evk which is referenced in the commit
message of that commit.

Signed-off-by: Lothar Waßmann <[email protected]>
---
arch/arm/boot/dts/imx28-evk.dts | 4 ++++
arch/arm/boot/dts/imx28.dtsi | 3 ++-
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index dff2279..ac790bb 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -361,3 +361,7 @@
default-brightness-level = <6>;
};
};
+
+&dcp {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index e459d63..ea99d09 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -794,9 +794,10 @@
};

dcp: dcp@80028000 {
+ compatible = "fsl-dcp";
reg = <0x80028000 0x2000>;
interrupts = <52 53 54>;
- compatible = "fsl-dcp";
+ status = "disabled";
};

pxp: pxp@8002a000 {
--
1.7.2.5


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2013-08-08 19:39:42

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 3/3] crypto: dcp: rename 'compatible' property to 'fsl,dcp'

Hello.

On 08/08/2013 05:30 PM, Lothar Waßmann wrote:

> Leave the old 'fsl-dcp' value in place with an appropriate comment
> until external users have updated their DTBs.

> Signed-off-by: Lothar Waßmann <[email protected]>
> ---
> arch/arm/boot/dts/imx28.dtsi | 2 +-
> drivers/crypto/dcp.c | 2 ++
> 2 files changed, 3 insertions(+), 1 deletions(-)

> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
> index ea99d09..0584935 100644
> --- a/arch/arm/boot/dts/imx28.dtsi
> +++ b/arch/arm/boot/dts/imx28.dtsi
> @@ -794,7 +794,7 @@
> };
>
> dcp: dcp@80028000 {

By the way, I see that this is a crypto device, so it should be named
"crypto" according to ePAPR spec. [1]

> - compatible = "fsl-dcp";
> + compatible = "fsl,dcp";
> reg = <0x80028000 0x2000>;
> interrupts = <52 53 54>;
> status = "disabled";

[1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

WBR, Sergei

2013-08-08 21:14:08

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH 0/3] ARM: dts: mxs: dcp cleanup patches


On Aug 8, 2013, at 8:30 AM, Lothar Wa?mann wrote:

> This patch series does the following:
>
> - let the driver be "disabled" by default in imx28.dtsi
> - coding style cleanups in drivers/crypto/dcp.c
> - use the "official" 'fsl,' prefix in the 'compatible' property
>
> The last patch adds a new entry to the of_match_table of the driver,
> so that current DT blobs will still work. When out of tree users
> (mentioned in the commit log of 519d8b1a "Added support for
> Freescale's DCP co-processor") have updated their DTBs the old entry
> 'fsl-dsp' can be removed from the driver.
>
> This patch series requires at least
> "[PATCH 2/8] ARM: dts: mxs: add labels to most nodes for easier reference"
> from the patch series:
> <[email protected]> to be
> applied.
>
> arch/arm/boot/dts/imx28.dtsi | 2 +-
> b/arch/arm/boot/dts/imx28-evk.dts | 4 ++++
> b/arch/arm/boot/dts/imx28.dtsi | 3 ++-
> b/drivers/crypto/dcp.c | 11 +++++------
> drivers/crypto/dcp.c | 2 ++
> 5 files changed, 14 insertions(+), 8 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

Is there an actual binding spec for fsl,dcp? If not, there really should be.

- k

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

2013-08-12 11:05:26

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: mxs: set dcp to "disabled" by default

On Thu, Aug 08, 2013 at 03:30:27PM +0200, Lothar Wa?mann wrote:
> Reintroduce 'status = "disabled"' for the dcp node that was dropped by
> commit 519d8b1a "Added support for Freescale's DCP co-processor".

For IP blocks that do not have pins to be routed on boards, it should be
fine to have it enabled in <soc>.dtsi.

Shawn

>
> Explicitly enable it in imx28-evk which is referenced in the commit
> message of that commit.
>
> Signed-off-by: Lothar Wa?mann <[email protected]>
> ---
> arch/arm/boot/dts/imx28-evk.dts | 4 ++++
> arch/arm/boot/dts/imx28.dtsi | 3 ++-
> 2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
> index dff2279..ac790bb 100644
> --- a/arch/arm/boot/dts/imx28-evk.dts
> +++ b/arch/arm/boot/dts/imx28-evk.dts
> @@ -361,3 +361,7 @@
> default-brightness-level = <6>;
> };
> };
> +
> +&dcp {
> + status = "okay";
> +};
> diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
> index e459d63..ea99d09 100644
> --- a/arch/arm/boot/dts/imx28.dtsi
> +++ b/arch/arm/boot/dts/imx28.dtsi
> @@ -794,9 +794,10 @@
> };
>
> dcp: dcp@80028000 {
> + compatible = "fsl-dcp";
> reg = <0x80028000 0x2000>;
> interrupts = <52 53 54>;
> - compatible = "fsl-dcp";
> + status = "disabled";
> };
>
> pxp: pxp@8002a000 {
> --
> 1.7.2.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2013-08-12 12:05:59

by Lothar Waßmann

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: mxs: set dcp to "disabled" by default

Hi,

Shawn Guo writes:
> On Thu, Aug 08, 2013 at 03:30:27PM +0200, Lothar Waßmann wrote:
> > Reintroduce 'status = "disabled"' for the dcp node that was dropped by
> > commit 519d8b1a "Added support for Freescale's DCP co-processor".
>
> For IP blocks that do not have pins to be routed on boards, it should be
> fine to have it enabled in <soc>.dtsi.
>
That means that when a new driver is added, it will start wasting
resources on all board using that SoC unless the board maintainers
explicitly disable that driver in DTB.

I would prefer things to be the other way:
New drivers (no matter whether for chip-internal or external hardware)
should require to be explicitly enabled for those platforms on which
they are being used.


Lothar Waßmann
--
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

http://www.karo-electronics.de | [email protected]
___________________________________________________________

2013-08-12 14:17:00

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: mxs: set dcp to "disabled" by default


On Aug 12, 2013, at 7:05 AM, Lothar Wa?mann wrote:

> Hi,
>
> Shawn Guo writes:
>> On Thu, Aug 08, 2013 at 03:30:27PM +0200, Lothar Wa?mann wrote:
>>> Reintroduce 'status = "disabled"' for the dcp node that was dropped by
>>> commit 519d8b1a "Added support for Freescale's DCP co-processor".
>>
>> For IP blocks that do not have pins to be routed on boards, it should be
>> fine to have it enabled in <soc>.dtsi.
>>
> That means that when a new driver is added, it will start wasting
> resources on all board using that SoC unless the board maintainers
> explicitly disable that driver in DTB.
>
> I would prefer things to be the other way:
> New drivers (no matter whether for chip-internal or external hardware)
> should require to be explicitly enabled for those platforms on which
> they are being used.

But that enablement should be in the kernel and not the device tree. The device tree is describing the HW, if the DCP exists and is usable w/o an external IO than by default it should be enabled in the SoC .dts

- k

--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation