From: Peng Fan Date: Sun, 11 Dec 2016 11:24:33 +0000 (+0800) Subject: OCOTP: Update OCOTP driver to support i.MX6SLL X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=b2ebdd85d9a865d2baf6664e09e32ad583d739aa;p=u-boot.git OCOTP: Update OCOTP driver to support i.MX6SLL Add the i.MX6SLL support to OCOTP driver. The i.MX6SLL reuses the i.MX6ULL fuse, bank 7 and bank8 have 4 words each, and there is a hole between bank 5 and bank 6. Signed-off-by: Ye Li Signed-off-by: Peng Fan --- diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c index 8a100c19bd..0b1c05078f 100644 --- a/drivers/misc/mxc_ocotp.c +++ b/drivers/misc/mxc_ocotp.c @@ -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 @@ -79,7 +79,7 @@ /* * 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 i.MX6ULL. + * iMX6UL, i.MX6ULL and i.MX6SLL. * Bank 5 ends at 0x6F0 and Bank 6 starts at 0x800. When reading the fuses, * we should account for this hole in address space. * @@ -100,8 +100,8 @@ u32 fuse_bank_physical(int index) if (is_mx6sl()) { phy_index = index; - } else if (is_mx6ul() || is_mx6ull()) { - if (is_mx6ull() && index == 8) + } else if (is_mx6ul() || is_mx6ull() || is_mx6sll()) { + if ((is_mx6ull() || is_mx6sll()) && index == 8) index = 7; if (index >= 6) @@ -121,7 +121,7 @@ u32 fuse_bank_physical(int index) u32 fuse_word_physical(u32 bank, u32 word_index) { - if (is_mx6ull()) { + if (is_mx6ull() || is_mx6sll()) { if (bank == 8) word_index = word_index + 4; } @@ -164,10 +164,10 @@ static int prepare_access(struct ocotp_regs **regs, u32 bank, u32 word, return -EINVAL; } - if (is_mx6ull()) { + if (is_mx6ull() || is_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; } } @@ -271,7 +271,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 for i.MX6ULL */ - if ((is_mx6ull()) && (bank > 7)) { + if ((is_mx6ull() || is_mx6sll()) && (bank > 7)) { bank = bank - 1; word += 4; }