
In message 31ADFA827355984B9E2A161514595B561C33A3@lpdsrv04.logicpd.com you wrote:
I'm back revisiting the CFI driver, and am wondering which of these is the intent of the sector protection for memory at (CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1):
- "MONITOR" refers to the bootloader _and_ environment
Correct for configurations with embedded environment.
- "MONITOR" refers to _just_ the bootloader
Correct for configurations with separate environment.
If 1, cfi_flash.c can stay as it is with:
/* Monitor protection ON by default */
#if (CFG_MONITOR_BASE >= CFG_FLASH_BASE) flash_protect (FLAG_PROTECT_SET, CFG_MONITOR_BASE, CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, &flash_info[0]); #endif
Otherwise, with 2, it should have a second block to protect the environment.
You are right. It should have this, in case of configurations with separate environment.
This is only useful if it's common for boards to keep the bootloader and environment in non-contiguous segments of memory. Is that common?
This is one of the common configurations.
Best regards,
Wolfgang Denk