1
0
Fork 0

MLK-24529 nvmem: ocotp: use high bus when programming/reloading fuse

There might be chance that after we calculate timing based on the ipg_clk,
but ipg_clk was changed by busfreq which cause fuse prog and shadow
reload not work stable. So let request high bus to let the ipg clk fixed
during the stage programming and reloading.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 9e259c937528ce98f910d256c2f2fddea258a694)
5.4-rM2-2.2.x-imx-squashed
Peng Fan 2020-08-21 16:35:16 +08:00
parent 49f5ac5c8a
commit 970a98ea92
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@
* Copyright (C) 2010-2013 Freescale Semiconductor, Inc
*/
#include <linux/busfreq-imx.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
@ -319,6 +320,8 @@ static int imx_ocotp_write(void *context, unsigned int offset, void *val,
return ret;
}
request_bus_freq(BUS_FREQ_HIGH);
/* Setup the write timing values */
priv->params->set_timing(priv);
@ -458,6 +461,8 @@ static int imx_ocotp_write(void *context, unsigned int offset, void *val,
}
write_end:
release_bus_freq(BUS_FREQ_HIGH);
clk_disable_unprepare(priv->clk);
mutex_unlock(&ocotp_mutex);
if (ret < 0)