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>
This commit is contained in:
Peng Fan 2020-08-21 16:35:16 +08:00
parent 72d77299fc
commit 9e259c9375
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)