Skip to content

Commit 4e8fccb

Browse files
authored
Merge pull request #437 from MulattoKid/flash_W25QxxxJV
Add support for more flash sizes in W25QxxxJV series
2 parents a553dc9 + f7cd3f9 commit 4e8fccb

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

docs/Targets.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ WolfBoot currently supports the NXP RT1050, RT1060/1062, and RT1064 devices.
12271227
MCUXpresso SDK is required by wolfBoot to access device drivers on this platform.
12281228
A package can be obtained from the [MCUXpresso SDK Builder](https://mcuxpresso.nxp.com/en/welcome), by selecting a target and keeping the default choice of components.
12291229

1230+
* For the RT1040 use `EVKB-IMXRT1040`. See configuration example in `config/examples/imx-rt1040.config`.
12301231
* For the RT1050 use `EVKB-IMXRT1050`. See configuration example in `config/examples/imx-rt1050.config`.
12311232
* For the RT1060 use `EVKB-IMXRT1060`. See configuration example in `config/examples/imx-rt1060.config`.
12321233
* For the RT1064 use `EVK-IMXRT1064`. See configuration example in `config/examples/imx-rt1064.config`.
@@ -1239,7 +1240,7 @@ DCP support (hardware acceleration for SHA256 operations) can be enabled by usin
12391240

12401241
Firmware can be directly uploaded to the target by copying `factory.bin` to the virtual USB drive associated to the device, or by loading the image directly into flash using a JTAG/SWD debugger.
12411242

1242-
The RT1050 EVKB board comes wired to use the 64MB HyperFlash. If you'd like to use QSPI there is a rework that can be performed (see AN12183). The default onboard QSPI 8MB ISSI IS25WP064A (`CONFIG_FLASH_IS25WP064A`). To use a Winbond W25Q64JV define `CONFIG_FLASH_W25Q64JV`.
1243+
The RT1050 EVKB board comes wired to use the 64MB HyperFlash. If you'd like to use QSPI there is a rework that can be performed (see AN12183). The default onboard QSPI 8MB ISSI IS25WP064A (`CONFIG_FLASH_IS25WP064A`). To use a 64Mbit Winbond W25Q64JV define `CONFIG_FLASH_W25Q64JV` (16Mbit, 32Mbit, 128Mbit, 256Mbit and 512Mbit versions are also available). These options are also available for the RT1040 target.
12431244

12441245
You can also get the SDK and CMSIS bundles using these repositories:
12451246
* https://github.com/nxp-mcuxpresso/mcux-sdk

hal/imx_rt.c

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,39 @@ const flexspi_nor_config_t __attribute__((section(".flash_config"))) qspiflash_c
282282
/** Flash configuration in the .flash_config section of flash **/
283283
#if defined(CPU_MIMXRT1042XJM5B) || defined(CPU_MIMXRT1052DVJ6B)
284284

285-
#ifdef CONFIG_FLASH_W25Q64JV
285+
#if defined(CONFIG_FLASH_W25Q16JV)
286+
/* Winbond W25Q16JV */
287+
#define CONFIG_FLASH_SIZE (2 * 1024 * 1024) /* 2MBytes */
288+
#define WRITE_STATUS_CMD 0x31
289+
#define QE_ENABLE 0x02 /* S9 */
290+
#elif defined(CONFIG_FLASH_W25Q32JV)
291+
/* Winbond W25Q32JV */
292+
#define CONFIG_FLASH_SIZE (4 * 1024 * 1024) /* 4MBytes */
293+
#define WRITE_STATUS_CMD 0x31
294+
#define QE_ENABLE 0x02 /* S9 */
295+
#elif defined(CONFIG_FLASH_W25Q64JV)
286296
/* Winbond W25Q64JV */
287-
#define WRITE_STATUS_CMD 0x31
288-
#define QE_ENABLE 0x02 /* S9 */
297+
#define CONFIG_FLASH_SIZE (8 * 1024 * 1024) /* 8MBytes */
298+
#define WRITE_STATUS_CMD 0x31
299+
#define QE_ENABLE 0x02 /* S9 */
300+
#elif defined(CONFIG_FLASH_W25Q128JV)
301+
/* Winbond W25Q128JV */
302+
#define CONFIG_FLASH_SIZE (16 * 1024 * 1024) /* 16MBytes */
303+
#define WRITE_STATUS_CMD 0x31
304+
#define QE_ENABLE 0x02 /* S9 */
305+
#elif defined(CONFIG_FLASH_W25Q256JV)
306+
/* Winbond W25Q256JV */
307+
#define CONFIG_FLASH_SIZE (32 * 1024 * 1024) /* 32MBytes */
308+
#define WRITE_STATUS_CMD 0x31
309+
#define QE_ENABLE 0x02 /* S9 */
310+
#elif defined(CONFIG_FLASH_W25Q512JV)
311+
/* Winbond W25Q512JV */
312+
#define CONFIG_FLASH_SIZE (64 * 1024 * 1024) /* 64MBytes */
313+
#define WRITE_STATUS_CMD 0x31
314+
#define QE_ENABLE 0x02 /* S9 */
289315
#elif defined(CONFIG_FLASH_IS25WP064A)
290316
/* ISSI IS25WP064A (on EVKB with rework see AN12183) */
317+
#define CONFIG_FLASH_SIZE (8 * 1024 * 1024) /* 8MBytes */
291318
#define WRITE_STATUS_CMD 0x1
292319
#define QE_ENABLE 0x40 /* S6 */
293320
#elif !defined(CONFIG_HYPERFLASH)
@@ -428,7 +455,6 @@ const flexspi_nor_config_t __attribute__((section(".flash_config"))) qspiflash_c
428455
};
429456
#else /* QSPI */
430457

431-
#define CONFIG_FLASH_SIZE (8 * 1024 * 1024) /* 8MBytes */
432458
#define CONFIG_FLASH_PAGE_SIZE 256UL /* 256Bytes */
433459
#define CONFIG_FLASH_SECTOR_SIZE (4 * 1024) /* 4Bytes */
434460
#define CONFIG_FLASH_BLOCK_SIZE (64 * 1024) /* 64KBytes */

0 commit comments

Comments
 (0)