Hi,
I am burning some fuses with the help of the ocotp driver on my IMX8MP board. Among other things, I am burning the mac addresses (HW_OCOTP_MAC_ADDR0, HW_OCOTP_MAC_ADDR1, HW_OCOTP_MAC_ADDR2). I am opening the file exposed by the ocotp driver (for me it's located at /sys/bus/nvmem/devices/imx-ocotp0/nvmem) and writing data to it. It works fine, when rebooting the board the mac addresses are set. But now I want to lock these fuses, so no one can write another mac address to the board, or tamper with it in some way.
When reading the reference manual, under section 6.3.2.1.3, I can see that
"Shadow register bits can be overridden by software until the corresponding fuse lock bit for the region is set. When the lock shadow bit is set, the shadow registers for that lock region become write locked."
Then it is explained that
"In order to avoid "rogue" code performing erroneous writes to OTP, a special unlocking
sequence is required for writes to the fuse banks. To program fuse bank complete the
following steps:"
Here I am getting a bit lost. Maybe I misunderstand something about fuse writing, but my understanding has always been that once we flip a fuse bit, that bit is forever locked. I want to make sure that non-flipped bits (where we might have written zeroes for example) cannot be flipped. I don't want to have a way to unlock the fuse writing. So my questions are:
1. How can this be done for e.g. mac addresses?
2. Can it be done in userspace with the ocotp driver?
Thanks,
Jonas