Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-24 Thread Fabio Estevam
Hi Herbert,

On Tue, Apr 24, 2018 at 1:39 PM, Herbert Xu  wrote:

> As this is a new device support issue I'd prefer to delay this
> until the next merge window.

Understood.

I will send a patch that passes ''fsl,sec-era' property in the dts, so
that we can have CAAM working on 4.17 fon i.MX7.

Thanks


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-24 Thread Herbert Xu
Hi Fabio:

On Fri, Apr 20, 2018 at 03:21:47PM -0300, Fabio Estevam wrote:
> 
> It is not a regression.
> 
> We haven't seen this problem before because dtsi files passed the
> 'fsl,sec-era' property.
> 
> Since 4.17-rc1, imx7 supports CAAM:
> 0eeabcad7da5  ("ARM: dts: imx7s: add CAAM device node")
> 
> ,but it does not pass the 'fsl,sec-era' property leading to the following 
> error:
> caam 3090.caam: device ID = 0x0a160300 (Era -524)
> 
> Documentation/devicetree/bindings/crypto/fsl-sec4.txt states that
> 'fsl,sec-era' property is optional, so 0eeabcad7da5 is not incorrect
> by not passing it.
> 
> As we can retrieve the era information by reading the CAAM registers
> we can fix the problem on imx7 running 4.17-rc with this patch.

As this is a new device support issue I'd prefer to delay this
until the next merge window.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-20 Thread Fabio Estevam
Hi Herbert,

On Fri, Apr 20, 2018 at 3:01 PM, Herbert Xu  wrote:

> Is this a regression or a preexisting bug?

It is not a regression.

We haven't seen this problem before because dtsi files passed the
'fsl,sec-era' property.

Since 4.17-rc1, imx7 supports CAAM:
0eeabcad7da5  ("ARM: dts: imx7s: add CAAM device node")

,but it does not pass the 'fsl,sec-era' property leading to the following error:
caam 3090.caam: device ID = 0x0a160300 (Era -524)

Documentation/devicetree/bindings/crypto/fsl-sec4.txt states that
'fsl,sec-era' property is optional, so 0eeabcad7da5 is not incorrect
by not passing it.

As we can retrieve the era information by reading the CAAM registers
we can fix the problem on imx7 running 4.17-rc with this patch.

Thanks


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-20 Thread Herbert Xu
On Fri, Apr 20, 2018 at 02:11:07PM -0300, Fabio Estevam wrote:
>
> Would it be possible to consider applying this one for 4.17-rc?
> 
> Without this patch we get incorrect CAAM IP block version (era) on
> i.MX7 on 4.17-rc1:
> 
> caam 3090.caam: device ID = 0x0a160300 (Era -524)

Is this a regression or a preexisting bug?

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-20 Thread Fabio Estevam
Hi Herbert,

On Fri, Apr 20, 2018 at 1:52 PM, Herbert Xu  wrote:
> On Wed, Apr 11, 2018 at 09:45:20AM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam 
>>
>> The 'era' information can be retrieved from CAAM registers, so
>> introduce a caam_get_era_from_hw() function that gets it via register
>> reads in case the 'fsl,sec-era' property is not passed in the device
>> tree.
>>
>> This function is based on the U-Boot implementation from
>> drivers/crypto/fsl/sec.c
>>
>> Signed-off-by: Fabio Estevam 
>
> Patch applied.  Thanks.

Would it be possible to consider applying this one for 4.17-rc?

Without this patch we get incorrect CAAM IP block version (era) on
i.MX7 on 4.17-rc1:

caam 3090.caam: device ID = 0x0a160300 (Era -524)

Thanks


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-20 Thread Herbert Xu
On Wed, Apr 11, 2018 at 09:45:20AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> The 'era' information can be retrieved from CAAM registers, so
> introduce a caam_get_era_from_hw() function that gets it via register
> reads in case the 'fsl,sec-era' property is not passed in the device
> tree.
> 
> This function is based on the U-Boot implementation from
> drivers/crypto/fsl/sec.c
> 
> Signed-off-by: Fabio Estevam 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-12 Thread Breno Matheus Lima
Hi Fabio,

2018-04-11 9:45 GMT-03:00 Fabio Estevam :
> From: Fabio Estevam 
>
> The 'era' information can be retrieved from CAAM registers, so
> introduce a caam_get_era_from_hw() function that gets it via register
> reads in case the 'fsl,sec-era' property is not passed in the device
> tree.
>
> This function is based on the U-Boot implementation from
> drivers/crypto/fsl/sec.c
>
> Signed-off-by: Fabio Estevam 

I have just tested on a mx7dsabresd board and confirmed that the ERA
is correctly retrieved:

Without your patch:

[2.182756] caam 3090.caam: device ID = 0x0a160300 (Era -524)

With your patch applied:

[2.183526] caam 3090.caam: device ID = 0x0a160300 (Era 8)

Tested-by: Breno Lima 

Thanks,
Breno Lima


Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-11 Thread Horia Geantă
On 4/11/2018 3:45 PM, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> The 'era' information can be retrieved from CAAM registers, so
> introduce a caam_get_era_from_hw() function that gets it via register
> reads in case the 'fsl,sec-era' property is not passed in the device
> tree.
> 
> This function is based on the U-Boot implementation from
> drivers/crypto/fsl/sec.c
> 
> Signed-off-by: Fabio Estevam 
Reviewed-by: Horia Geantă 
for the series.

Thanks,
Horia