Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXP drivers: flash: soc_flash_mcux: remove CMD_MARGIN_CHECK #83472

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions drivers/flash/soc_flash_mcux.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static uint32_t get_cmd_status(uint32_t cmd, uint32_t addr, size_t len)
}

/* This function prevents erroneous reading. Some ECC enabled devices will
* crash when reading an erased or wrongly programmed area.
* crash when reading an erased area.
*/
static status_t is_area_readable(uint32_t addr, size_t len)
{
Expand All @@ -102,21 +102,13 @@ static status_t is_area_readable(uint32_t addr, size_t len)

key = irq_lock();

/* Check if the are is correctly programmed and can be read. */
status = get_cmd_status(FMC_CMD_MARGIN_CHECK, addr, len);
if (status & FMC_STATUS_FAILURES) {
/* If the area was erased, ECC errors are triggered on read. */
status = get_cmd_status(FMC_CMD_BLANK_CHECK, addr, len);
if (!(status & FMC_STATUS_FAIL)) {
LOG_DBG("read request on erased addr:0x%08x size:%d",
addr, len);
irq_unlock(key);
return -ENODATA;
}
LOG_DBG("read request error for addr:0x%08x size:%d",
/* If the area was erased, ECC errors are triggered on read. */
status = get_cmd_status(FMC_CMD_BLANK_CHECK, addr, len);
if (!(status & FMC_STATUS_FAIL)) {
LOG_DBG("read request on erased addr:0x%08x size:%d",
addr, len);
irq_unlock(key);
return -EIO;
return -ENODATA;
}

irq_unlock(key);
Expand Down
Loading