Skip to content

Commit 2fe4ab6

Browse files
DerekSnelldecsny
authored andcommitted
drivers: flash_k4: update to support MCXN series
Enables MCXN series to use this flash driver instead of ROM APIs. Adds PFLASH feature macros to the MCXNx4x derivatives. Signed-off-by: Derek Snell <[email protected]>
1 parent cea5006 commit 2fe4ab6

14 files changed

+333
-42
lines changed

mcux/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Patch List:
179179
- Add missing CMAKE files device_system.cmake device_CMSIS.cmake and drivers/driver_reset.cmake to MCXW716C.
180180
- Add missing CMAKE file to ccm32k driver driver_ccm32k.cmake.
181181
- Add missing CMAKE file to flash_k4 driver driver_flash_k4.cmake.
182+
- drivers: k4_flash: update to support MCXN series
183+
- mcux-sdk-ng/devices/MCX/MCXN/MCXNx4x/MCXNx4x_cm33_core0_features.h and core1 added PFLASH feature macros
182184
- Add missing CMAKE file to spc driver driver_spc.cmake
183185
- mcux-sdk/drivers/dspi/fsl_dspi.c, mcux-sdk/drivers/dspi/fsl_dspi.h, mcux-sdk/drivers/dspi/fsl_dspi_edma.c,
184186
mcux-sdk/drivers/dspi/fsl_dspi_edma.h: add the guards for unsupport features on S32Z27x devices

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN546/MCXN546_cm33_core0_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -495,6 +495,25 @@
495495
/* @brief FlexSPI Array Length */
496496
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
497497

498+
/* FMU module features */
499+
500+
/* @brief P-Flash block0 start address. */
501+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
502+
/* @brief P-Flash block count. */
503+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
504+
/* @brief P-Flash block0 size. */
505+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
506+
/* @brief flash BLOCK0 IFR0 start address. */
507+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
508+
/* @brief flash block IFR0 size. */
509+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
510+
/* @brief P-Flash sector size. */
511+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
512+
/* @brief P-Flash phrase size. */
513+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
514+
/* @brief P-Flash page size. */
515+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
516+
498517
/* GPIO module features */
499518

500519
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN546/MCXN546_cm33_core1_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -495,6 +495,25 @@
495495
/* @brief FlexSPI Array Length */
496496
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
497497

498+
/* FMU module features */
499+
500+
/* @brief P-Flash block0 start address. */
501+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
502+
/* @brief P-Flash block count. */
503+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
504+
/* @brief P-Flash block0 size. */
505+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
506+
/* @brief flash BLOCK0 IFR0 start address. */
507+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
508+
/* @brief flash block IFR0 size. */
509+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
510+
/* @brief P-Flash sector size. */
511+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
512+
/* @brief P-Flash phrase size. */
513+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
514+
/* @brief P-Flash page size. */
515+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
516+
498517
/* GPIO module features */
499518

500519
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN547/MCXN547_cm33_core0_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -495,6 +495,25 @@
495495
/* @brief FlexSPI Array Length */
496496
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
497497

498+
/* FMU module features */
499+
500+
/* @brief P-Flash block0 start address. */
501+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
502+
/* @brief P-Flash block count. */
503+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
504+
/* @brief P-Flash block0 size. */
505+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
506+
/* @brief flash BLOCK0 IFR0 start address. */
507+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
508+
/* @brief flash block IFR0 size. */
509+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
510+
/* @brief P-Flash sector size. */
511+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
512+
/* @brief P-Flash phrase size. */
513+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
514+
/* @brief P-Flash page size. */
515+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
516+
498517
/* GPIO module features */
499518

500519
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN547/MCXN547_cm33_core1_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -495,6 +495,25 @@
495495
/* @brief FlexSPI Array Length */
496496
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
497497

498+
/* FMU module features */
499+
500+
/* @brief P-Flash block0 start address. */
501+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
502+
/* @brief P-Flash block count. */
503+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
504+
/* @brief P-Flash block0 size. */
505+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
506+
/* @brief flash BLOCK0 IFR0 start address. */
507+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
508+
/* @brief flash block IFR0 size. */
509+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
510+
/* @brief P-Flash sector size. */
511+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
512+
/* @brief P-Flash phrase size. */
513+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
514+
/* @brief P-Flash page size. */
515+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
516+
498517
/* GPIO module features */
499518

500519
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN946/MCXN946_cm33_core0_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -611,6 +611,25 @@
611611
/* @brief FlexSPI Array Length */
612612
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
613613

614+
/* FMU module features */
615+
616+
/* @brief P-Flash block0 start address. */
617+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
618+
/* @brief P-Flash block count. */
619+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
620+
/* @brief P-Flash block0 size. */
621+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
622+
/* @brief flash BLOCK0 IFR0 start address. */
623+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
624+
/* @brief flash block IFR0 size. */
625+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
626+
/* @brief P-Flash sector size. */
627+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
628+
/* @brief P-Flash phrase size. */
629+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
630+
/* @brief P-Flash page size. */
631+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
632+
614633
/* GPIO module features */
615634

616635
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN946/MCXN946_cm33_core1_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -611,6 +611,25 @@
611611
/* @brief FlexSPI Array Length */
612612
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
613613

614+
/* FMU module features */
615+
616+
/* @brief P-Flash block0 start address. */
617+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
618+
/* @brief P-Flash block count. */
619+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
620+
/* @brief P-Flash block0 size. */
621+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
622+
/* @brief flash BLOCK0 IFR0 start address. */
623+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
624+
/* @brief flash block IFR0 size. */
625+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
626+
/* @brief P-Flash sector size. */
627+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
628+
/* @brief P-Flash phrase size. */
629+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
630+
/* @brief P-Flash page size. */
631+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
632+
614633
/* GPIO module features */
615634

616635
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN947/MCXN947_cm33_core0_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -619,6 +619,25 @@
619619
/* @brief FlexSPI Array Length */
620620
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
621621

622+
/* FMU module features */
623+
624+
/* @brief P-Flash block0 start address. */
625+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
626+
/* @brief P-Flash block count. */
627+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
628+
/* @brief P-Flash block0 size. */
629+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
630+
/* @brief flash BLOCK0 IFR0 start address. */
631+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
632+
/* @brief flash block IFR0 size. */
633+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
634+
/* @brief P-Flash sector size. */
635+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
636+
/* @brief P-Flash phrase size. */
637+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
638+
/* @brief P-Flash page size. */
639+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
640+
622641
/* GPIO module features */
623642

624643
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN947/MCXN947_cm33_core1_features.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
22
** ###################################################################
33
** Version: rev. 1.0, 2021-08-03
4-
** Build: b241112
4+
** Build: b250512
55
**
66
** Abstract:
77
** Chip specific module features.
88
**
99
** Copyright 2016 Freescale Semiconductor, Inc.
10-
** Copyright 2016-2024 NXP
10+
** Copyright 2016-2025 NXP
1111
** SPDX-License-Identifier: BSD-3-Clause
1212
**
1313
** http: www.nxp.com
@@ -619,6 +619,25 @@
619619
/* @brief FlexSPI Array Length */
620620
#define FSL_FEATURE_FLEXSPI_ARRAY_LEN (1)
621621

622+
/* FMU module features */
623+
624+
/* @brief P-Flash block0 start address. */
625+
#define FSL_FEATURE_FLASH_PFLASH_START_ADDRESS (0x00000000U)
626+
/* @brief P-Flash block count. */
627+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT (2)
628+
/* @brief P-Flash block0 size. */
629+
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE (0x100000U)
630+
/* @brief flash BLOCK0 IFR0 start address. */
631+
#define FSL_FEATURE_FLASH_IFR0_START_ADDRESS (0x01000000u)
632+
/* @brief flash block IFR0 size. */
633+
#define FSL_FEATURE_FLASH_IFR0_SIZE (0x8000U)
634+
/* @brief P-Flash sector size. */
635+
#define FSL_FEATURE_FLASH_PFLASH_SECTOR_SIZE (0x2000U)
636+
/* @brief P-Flash phrase size. */
637+
#define FSL_FEATURE_FLASH_PFLASH_PHRASE_SIZE (16)
638+
/* @brief P-Flash page size. */
639+
#define FSL_FEATURE_FLASH_PFLASH_PAGE_SIZE (128)
640+
622641
/* GPIO module features */
623642

624643
/* @brief Has GPIO attribute checker register (GACR). */

mcux/mcux-sdk-ng/drivers/flash_k4/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: BSD-3-Clause
44

55
if(CONFIG_MCUX_COMPONENT_driver.flash_k4)
6-
mcux_component_version(2.1.1)
6+
mcux_component_version(2.2.1)
77

88
mcux_add_source(
99
SOURCES

0 commit comments

Comments
 (0)