Browse Source

MLK-13307-13 OCOTP: Update OCOTP driver to support i.MX6SLL

The i.MX6SLL reuses the i.MX6ULL fuse, and has same fuse bank map.
Add the i.MX6SLL support to OCOTP driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
imx_v2016.03_4.1.30_7ulp_alpha
Ye Li 4 years ago
committed by Peng Fan
parent
commit
45e47b2259
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      drivers/misc/mxc_ocotp.c

+ 10
- 8
drivers/misc/mxc_ocotp.c View File

@ -62,7 +62,7 @@
#define FUSE_BANK_SIZE 0x80
#ifdef CONFIG_MX6SL
#define FUSE_BANKS 8
#elif defined CONFIG_MX6ULL
#elif defined(CONFIG_MX6ULL) || defined(CONFIG_MX6SLL)
#define FUSE_BANKS 9
#else
#define FUSE_BANKS 16
@ -78,7 +78,8 @@
/*
* There is a hole in shadow registers address map of size 0x100
* between bank 5 and bank 6 on iMX6QP, iMX6DQ, iMX6SDL, iMX6SX, iMX6UL and iMX6ULL.
* between bank 5 and bank 6 on iMX6QP, iMX6DQ, iMX6SDL, iMX6SX, iMX6UL,
* iMX6ULL and iMX6SLL.
* Bank 5 ends at 0x6F0 and Bank 6 starts at 0x800. When reading the fuses,
* we should account for this hole in address space.
*
@ -99,8 +100,9 @@ u32 fuse_bank_physical(int index)
if (is_cpu_type(MXC_CPU_MX6SL)) {
phy_index = index;
} else if (is_cpu_type(MXC_CPU_MX6UL) || is_cpu_type(MXC_CPU_MX6ULL)) {
if (is_cpu_type(MXC_CPU_MX6ULL) && index == 8)
} else if (is_cpu_type(MXC_CPU_MX6UL) || is_cpu_type(MXC_CPU_MX6ULL) ||
is_cpu_type(MXC_CPU_MX6SLL)) {
if ((is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6SLL)) && index == 8)
index = 7;
if (index >= 6)
@ -120,7 +122,7 @@ u32 fuse_bank_physical(int index)
u32 fuse_word_physical(u32 bank, u32 word_index)
{
if (is_cpu_type(MXC_CPU_MX6ULL)) {
if (is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6SLL)) {
if (bank == 8)
word_index = word_index + 4;
}
@ -163,10 +165,10 @@ static int prepare_access(struct ocotp_regs **regs, u32 bank, u32 word,
return -EINVAL;
}
if (is_cpu_type(MXC_CPU_MX6ULL)) {
if (is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6SLL)) {
if ((bank == 7 || bank == 8) &&
word >= ARRAY_SIZE((*regs)->bank[0].fuse_regs) >> 3) {
printf("mxc_ocotp %s(): Invalid argument on 6ULL\n", caller);
printf("mxc_ocotp %s(): Invalid argument\n", caller);
return -EINVAL;
}
}
@ -270,7 +272,7 @@ static void setup_direct_access(struct ocotp_regs *regs, u32 bank, u32 word,
#else
u32 addr;
/* Bank 7 and Bank 8 only supports 4 words each */
if ((is_cpu_type(MXC_CPU_MX6ULL)) && (bank > 7)) {
if ((is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6SLL)) && (bank > 7)) {
bank = bank - 1;
word += 4;
}


Loading…
Cancel
Save