MLK-16204-4 nvmem: imx-ocotp: add i.mx8mq support and fix read
authorPeng Fan <peng.fan@nxp.com>
Fri, 18 Aug 2017 03:19:08 +0000 (11:19 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Thu, 18 Apr 2019 00:00:38 +0000 (03:00 +0300)
commitebba5d1223b3f8a89bbe992d471140fd3f3f15d9
tree1f0e558d93af51cdad72536c6b5d9660da31cfda
parent35b8e3276c7aad22f827d363d9b21c4f53508443
MLK-16204-4 nvmem: imx-ocotp: add i.mx8mq support and fix read

Add i.MX8MQ support and Fix read.

When offset is not 4 bytes aligned, directly shift righty by 2 bits
will cause reading out wrong data. Since imx ocotp only supports
4 bytes reading once, we need handle offset is not 4 bytes aligned
and enlarge the bytes to 4 bytes aligned. After finished reading,
copy the needed data from buffer to caller and free buffer.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 23bcfaac856f3f0de9f3113c9c447a6133157019)
drivers/nvmem/imx-ocotp.c