Skip to content

Commit e8e43b6

Browse files
danieldegrassestephanosio
authored andcommitted
drivers: flash: flash_mcux_flexspi_nor: add IS25LP support
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]>
1 parent 43b0789 commit e8e43b6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/flash/flash_mcux_flexspi_nor.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data,
936936
{
937937
int ret;
938938
uint32_t vendor_id;
939+
uint32_t read_params;
939940

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

945946
/* Switch on manufacturer and vendor ID */
946947
switch (vendor_id & 0xFFFF) {
948+
case 0x609d: /* IS25LP flash, needs P[4:3] cleared with same method as IS25WP */
949+
read_params = 0xE0U;
950+
ret = flash_flexspi_nor_is25_clear_read_param(data, flexspi_lut, &read_params);
951+
if (ret < 0) {
952+
while (1) {
953+
/*
954+
* Spin here, this flash won't configure correctly.
955+
* We can't print a warning, as we are unlikely to
956+
* be able to XIP at this point.
957+
*/
958+
}
959+
}
960+
/* Still return an error- we want the JEDEC configuration to run */
961+
return -ENOTSUP;
947962
case 0x709d:
948963
/*
949964
* IS25WP flash. We can support this flash with the JEDEC probe,
950965
* but we need to insure P[6:3] are at the default value
951966
*/
952-
/* Install Set Read Parameters (Volatile) command */
953-
uint32_t read_params = 0;
967+
read_params = 0;
954968
ret = flash_flexspi_nor_is25_clear_read_param(data, flexspi_lut, &read_params);
955969
if (ret < 0) {
956970
while (1) {

0 commit comments

Comments
 (0)