summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-06-03 11:04:17 +0800
committerPeng Fan <peng.fan@nxp.com>2016-06-03 11:04:17 +0800
commit139a6f95be94f75e4038e0eacddbd1f0a365f601 (patch)
tree1ac682f1044709d8e171fd15be709d91f08bb267 /drivers
parent0b65071afaae9d6a49fb7dda2902f5c8bcd678c2 (diff)
downloadu-boot-imx-139a6f95be94f75e4038e0eacddbd1f0a365f601.zip
u-boot-imx-139a6f95be94f75e4038e0eacddbd1f0a365f601.tar.gz
u-boot-imx-139a6f95be94f75e4038e0eacddbd1f0a365f601.tar.bz2
MLK-12852 ocotp: mxc: mx6ull: fix GP3/GP4 prog
Bank 7 and Bank 8 only supports 4 words each. 'bank << 3 | word' is not correct when program bank 8, since ocotp controller actully use word index. For example: fuse prog 8 3 1; The word index is (8 << 3 | 3) --> 67. But actully it should be (7 << 3 | 7) ---> 63. So fix it. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/mxc_ocotp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c
index cd47a2b..2ab7898 100644
--- a/drivers/misc/mxc_ocotp.c
+++ b/drivers/misc/mxc_ocotp.c
@@ -268,7 +268,13 @@ static void setup_direct_access(struct ocotp_regs *regs, u32 bank, u32 word,
#ifdef CONFIG_MX7
u32 addr = bank;
#else
- u32 addr = bank << 3 | word;
+ u32 addr;
+ /* Bank 7 and Bank 8 only supports 4 words each */
+ if ((is_cpu_type(MXC_CPU_MX6ULL)) && (bank > 7)) {
+ bank = bank - 1;
+ word += 4;
+ }
+ addr = bank << 3 | word;
#endif
set_timing(regs);