Skip to content

Commit

Permalink
drivers: flash: flash_mcux_flexspi_nor: add IS25LP support
Browse files Browse the repository at this point in the history
IS25LP flash chips have a similar P[6:3] register to the IS25WP series,
and need the same workaround.

Signed-off-by: Daniel DeGrasse <[email protected]>
  • Loading branch information
danieldegrasse authored and stephanosio committed Oct 23, 2024
1 parent 43b0789 commit e8e43b6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions drivers/flash/flash_mcux_flexspi_nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data,
{
int ret;
uint32_t vendor_id;
uint32_t read_params;

ret = flash_flexspi_nor_read_id_helper(data, (uint8_t *)&vendor_id);
if (ret < 0) {
Expand All @@ -944,13 +945,26 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data,

/* Switch on manufacturer and vendor ID */
switch (vendor_id & 0xFFFF) {
case 0x609d: /* IS25LP flash, needs P[4:3] cleared with same method as IS25WP */
read_params = 0xE0U;
ret = flash_flexspi_nor_is25_clear_read_param(data, flexspi_lut, &read_params);
if (ret < 0) {
while (1) {
/*
* Spin here, this flash won't configure correctly.
* We can't print a warning, as we are unlikely to
* be able to XIP at this point.
*/
}
}
/* Still return an error- we want the JEDEC configuration to run */
return -ENOTSUP;
case 0x709d:
/*
* IS25WP flash. We can support this flash with the JEDEC probe,
* but we need to insure P[6:3] are at the default value
*/
/* Install Set Read Parameters (Volatile) command */
uint32_t read_params = 0;
read_params = 0;
ret = flash_flexspi_nor_is25_clear_read_param(data, flexspi_lut, &read_params);
if (ret < 0) {
while (1) {
Expand Down

0 comments on commit e8e43b6

Please sign in to comment.