Commit Graph

4 Commits

Author SHA1 Message Date
ole00 dc16f92a2e sparse fusemap: optimise access when block bits are all 1 2024-02-16 19:44:52 +00:00
ole00 ba3caf3a15 sparse fusemap: added support for compacting
Compacting searches for fuse blocks where all 32 bits are set
to 1. If such block is found then it is removed from the
fuse array (reducing its top position) and then the fuse type
of such block is changed to 3.
Note that the fuse bit is never changed from 1 to 0, therefore
there is no need to cover these cases in the code (ie. converting
block type 3 to block type 1).

Compacting happens after every 256 fuse writes.

Compacting is required to be able to read erased GALs where
all fuse bits are initialised to 1.
2024-02-16 19:44:52 +00:00
ole00 f3147397f9 sparse fusemap: use 32 bit fuse blocks
Previously 16 bit fuse blocks were used and block types were stored in 1 bit.
That did not allow to compact fusemaps where all bits were 1 - which is
typically after the fuses are erased. So fuses of an erased chip would
not fit into the sparse memory array. The solution was to extend the fuse
block type storage from 1 bit to 2 bits and use that extra space to mark
blocks as sparse when all bits in the block are 1's. Such block is now
block type 3. To keep the fuseType array the same size as it was (128
bytes) the size of the block was extended from 16 bits to 32 bits.

The block type is now:
0 - all bits in the fuse block are 0, no block data in the fuse array
3 - all bits in the fuse block are 1, no block data in the fuse array
1 - any combination of bits in the fuse block, data are stored in the fuse array
2 - reserved for future use.
2024-02-16 19:44:52 +00:00
ole00 77a5d7d236 added support for sparse fusemap 2024-02-16 19:44:52 +00:00