hw/drivers/flash/spiflash: Add option to ignore JEDEC ID #2858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces three new optional configuration parameters:
SPIFLASH_IGNORE_MANUFACTURER
,SPIFLASH_IGNORE_MEMORY_TYPE
, andSPIFLASH_IGNORE_MEMORY_CAPACITY
. (Default:0
).These parameters selectively disable the whitelist checks of the SPI Flash JEDEC IDs.
Rationale
I am currently porting the InfiniTime OS (written for the PineTime smartwatch) to a popular Chinese smartwatch series called "P8".
mynewt-core
is used for the bootloader.These P8 watches come in a whole zoo of variants, each being compatible with the firmware but containing sometimes a bit different chips due to the silicon shortage and general chip availability on the global market. This is usually no problem to handle.
However, the SPI driver of
mynewt-core
enforces a strict whitelist on the reported SPI Flash JEDEC ID. I see how this is useful in normal applications where the hardware configuration is known in detail and compatibility has to be ensured, however this leads to my bootloader refusing to work on prior unknown / new smartwatch variants, bricking them.In the past, others and I have added definitions for SPI IDs (e.g. #2798 , #2582 ), but I can't keep up with all the models and I don't want to brick any more watches due to a purely whitelisting (not technical) issue.
I am open to suggestions, I think these optional configuration parameters would be quite useful to have.