Skip to content

Commit

Permalink
LFU-643 misc: imx_ele: Fix FSB redundancy fuse word check
Browse files Browse the repository at this point in the history
There is a bug when checking fuse word with redundancy fuse in FSB
table. The redundancy fuses are combined into 4 words, so we can't
directly use word index to do the check, otherwise the high 4 words
will fail to match.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
  • Loading branch information
Ye Li committed Feb 20, 2024
1 parent 398fdef commit b72b414
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/misc/imx_ele/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ static s32 map_fsb_fuse_index(u32 bank, u32 word, bool *redundancy)
/* map the fuse from ocotp fuse map to FSB*/
for (i = 0; i < size; i++) {
if (fsb_mapping_table[i].fuse_bank != -1 &&
fsb_mapping_table[i].fuse_bank == bank &&
fsb_mapping_table[i].fuse_words > word) {
fsb_mapping_table[i].fuse_bank == bank) {
break;
}

Expand All @@ -151,8 +150,13 @@ static s32 map_fsb_fuse_index(u32 bank, u32 word, bool *redundancy)
return -1; /* Failed to find */

if (fsb_mapping_table[i].redundancy) {
if ((fsb_mapping_table[i].fuse_words << 1) <= word)
return -2; /* Not valid word */

*redundancy = true;
return (word >> 1) + word_pos;
} else if (fsb_mapping_table[i].fuse_words <= word) {
return -2; /* Not valid word */
}

*redundancy = false;
Expand Down

0 comments on commit b72b414

Please sign in to comment.