nvmem: imx: correct the fuse word index

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>
This commit is contained in:
Fugang Duan 2019-06-06 19:14:50 +08:00 committed by Dong Aisheng
parent bb12203bdf
commit d92a35385e
1 changed files with 3 additions and 3 deletions

View File

@ -77,8 +77,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))
@ -106,7 +106,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);