Daniel Gröber (dxld) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41750 )
Change subject: spi/macronix: Add support for boot media protection ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/41750/5/src/drivers/spi/macronix.c File src/drivers/spi/macronix.c:
https://review.coreboot.org/c/coreboot/+/41750/5/src/drivers/spi/macronix.c@... PS5, Line 335: macronix_set_write_protection(const struct spi_flash *flash,
what Winbond calls the CMP bit is essentially just the highest BP bit in Macronix-lingo
Unfortunately it's not that easy best I can figure it's an arbitrary (non power-of-two) threshold that varies across capacities but in no obvious relation with it.
the TB bit you're not implementing here is actually supported on some Macronix chips like MX25V1635F
Ah, good point.
Is there any way you could manage to encode the differences between these in cofiguration structures and factor out code that works for both of them?
I spent some more time on this and merging the code paths doesn't make things too horrible. See CB:42124