lkml.org 
[lkml]   [2019]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH nvmem 1/1] nvmem: imx: correct the fuse word index
Date
Ping ...

> From: Fugang Duan <fugang.duan@nxp.com>
>
> iMX8 fuse word index represent as one 4-bytes word, it should not be divided
> by 4.
>
> Exp:
> - MAC0 address layout in fuse:
> offset 708: MAC[3] MAC[2] MAC[1] MAC[0]
> offset 709: XX xx MAC[5] MAC[4]
>
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
> ---
> drivers/nvmem/imx-ocotp-scu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.c
> index d9dc482..be2f5f0 100644
> --- a/drivers/nvmem/imx-ocotp-scu.c
> +++ b/drivers/nvmem/imx-ocotp-scu.c
> @@ -71,8 +71,8 @@ static int imx_scu_ocotp_read(void *context, unsigned
> int offset,
> void *p;
> int i, ret;
>
> - index = offset >> 2;
> - num_bytes = round_up((offset % 4) + bytes, 4);
> + index = offset;
> + num_bytes = round_up(bytes, 4);
> count = num_bytes >> 2;
>
> if (count > (priv->data->nregs - index)) @@ -100,7 +100,7 @@ static int
> imx_scu_ocotp_read(void *context, unsigned int offset,
> buf++;
> }
>
> - memcpy(val, (u8 *)p + offset % 4, bytes);
> + memcpy(val, (u8 *)p, bytes);
>
> kfree(p);
>
> --
> 2.7.4

\
 
 \ /
  Last update: 2019-07-15 07:35    [W:0.067 / U:5.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site