diff mbox series

[1/2] nvmem: imx-ocotp: imx8m is compatible with imx6 not imx7

Message ID cf5f5aff8289573332a96845900c4ecf519ed8db.1555623532.git.leonard.crestez@nxp.com (mailing list archive)
State Accepted
Headers show
Series [1/2] nvmem: imx-ocotp: imx8m is compatible with imx6 not imx7 | expand

Commit Message

Leonard Crestez April 18, 2019, 9:42 p.m. UTC
According to NXP Reference Manuals and uboot/atf sources the OCOTP block
on imx8m behaves more like imx6 than imx7.

- Fuses can be read/written 32bits at a time (no imx7-like banking)
- The OCOTP_HW_OCOTP_TIMING register is like imx6 not imx7

Since nvmem doesn't support uboot-style "sense" and "override" this
issue only affected "write" which is very rarely used.

Fixes: 163c0dbd0cb1 ("nvmem: imx-ocotp: add support for imx8mq")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 drivers/nvmem/imx-ocotp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peng Fan April 19, 2019, 4:16 a.m. UTC | #1
> Subject: [PATCH 1/2] nvmem: imx-ocotp: imx8m is compatible with imx6 not
> imx7
> 
> According to NXP Reference Manuals and uboot/atf sources the OCOTP block
> on imx8m behaves more like imx6 than imx7.
> 
> - Fuses can be read/written 32bits at a time (no imx7-like banking)
> - The OCOTP_HW_OCOTP_TIMING register is like imx6 not imx7
> 
> Since nvmem doesn't support uboot-style "sense" and "override" this issue
> only affected "write" which is very rarely used.
> 
> Fixes: 163c0dbd0cb1 ("nvmem: imx-ocotp: add support for imx8mq")
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---
>  drivers/nvmem/imx-ocotp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index
> 4cf7b61e4bf5..c3e1d9d8a537 100644
> --- a/drivers/nvmem/imx-ocotp.c
> +++ b/drivers/nvmem/imx-ocotp.c
> @@ -444,12 +444,12 @@ static const struct ocotp_params imx7ulp_params
> = {
>  	.bank_address_words = 0,
>  };
> 
>  static const struct ocotp_params imx8mq_params = {
>  	.nregs = 256,
> -	.bank_address_words = 4,
> -	.set_timing = imx_ocotp_set_imx7_timing,
> +	.bank_address_words = 0,
> +	.set_timing = imx_ocotp_set_imx6_timing,
>  };

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> 
>  static const struct of_device_id imx_ocotp_dt_ids[] = {
>  	{ .compatible = "fsl,imx6q-ocotp",  .data = &imx6q_params },
>  	{ .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_params },
> --
> 2.17.1
Bryan O'Donoghue April 19, 2019, 9:32 a.m. UTC | #2
On 18/04/2019 22:42, Leonard Crestez wrote:
> According to NXP Reference Manuals and uboot/atf sources the OCOTP block
> on imx8m behaves more like imx6 than imx7.
> 
> - Fuses can be read/written 32bits at a time (no imx7-like banking)
> - The OCOTP_HW_OCOTP_TIMING register is like imx6 not imx7
> 
> Since nvmem doesn't support uboot-style "sense" and "override" this
> issue only affected "write" which is very rarely used.
> 
> Fixes: 163c0dbd0cb1 ("nvmem: imx-ocotp: add support for imx8mq")
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---
>   drivers/nvmem/imx-ocotp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
> index 4cf7b61e4bf5..c3e1d9d8a537 100644
> --- a/drivers/nvmem/imx-ocotp.c
> +++ b/drivers/nvmem/imx-ocotp.c
> @@ -444,12 +444,12 @@ static const struct ocotp_params imx7ulp_params = {
>   	.bank_address_words = 0,
>   };
>   
>   static const struct ocotp_params imx8mq_params = {
>   	.nregs = 256,
> -	.bank_address_words = 4,
> -	.set_timing = imx_ocotp_set_imx7_timing,
> +	.bank_address_words = 0,
> +	.set_timing = imx_ocotp_set_imx6_timing,
>   };
>   
>   static const struct of_device_id imx_ocotp_dt_ids[] = {
>   	{ .compatible = "fsl,imx6q-ocotp",  .data = &imx6q_params },
>   	{ .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_params },
> 

Err.

I believe you are missing a few bits here.

Let me send through a patch-set I just completed this morning
diff mbox series

Patch

diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index 4cf7b61e4bf5..c3e1d9d8a537 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -444,12 +444,12 @@  static const struct ocotp_params imx7ulp_params = {
 	.bank_address_words = 0,
 };
 
 static const struct ocotp_params imx8mq_params = {
 	.nregs = 256,
-	.bank_address_words = 4,
-	.set_timing = imx_ocotp_set_imx7_timing,
+	.bank_address_words = 0,
+	.set_timing = imx_ocotp_set_imx6_timing,
 };
 
 static const struct of_device_id imx_ocotp_dt_ids[] = {
 	{ .compatible = "fsl,imx6q-ocotp",  .data = &imx6q_params },
 	{ .compatible = "fsl,imx6sl-ocotp", .data = &imx6sl_params },