From 3e3ec4e5207d739621b285c97bc83ddd5b67e50c Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 19:19:29 -0500 Subject: [PATCH 1/5] boards: arm: Add mcuboot flash partitions to mimxrt1064_evk Adds flash partitions and chosen nodes to the mimxrt1064_evk device tree to support mcuboot on the internal QSPI flash. This flash is rated for 100K minimum program-erase cycles per sector, therefore this partition configuration supports approximately 100K / (1984/64) = 3225 upgrades. Also enables FlexSPI flash driver XIP mode support on this board to support mcuboot. Signed-off-by: Maureen Helm --- boards/arm/mimxrt1064_evk/Kconfig.defconfig | 3 ++ boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts | 32 ++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/boards/arm/mimxrt1064_evk/Kconfig.defconfig b/boards/arm/mimxrt1064_evk/Kconfig.defconfig index b5fbbfb0e1a7bf..f49f2944c51360 100644 --- a/boards/arm/mimxrt1064_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1064_evk/Kconfig.defconfig @@ -18,6 +18,9 @@ config DISK_DRIVER_SDMMC config FLASH_MCUX_FLEXSPI_NOR default y if FLASH +config FLASH_MCUX_FLEXSPI_XIP + default y if FLASH + config I2C default y if KSCAN diff --git a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts index 13e0399c7d5948..dda42d0b7cf0f1 100644 --- a/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts +++ b/boards/arm/mimxrt1064_evk/mimxrt1064_evk.dts @@ -20,6 +20,9 @@ }; chosen { + zephyr,flash-controller = &flexspi2; + zephyr,flash = &w25q32jvwj0; + zephyr,code-partition = &slot0_partition; zephyr,sram = &sdram0; zephyr,itcm = &itcm; zephyr,dtcm = &dtcm; @@ -160,6 +163,35 @@ arduino_i2c: &lpi2c1 {}; }; }; +&flexspi2 { + status = "okay"; +}; + +&w25q32jvwj0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; + }; + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 DT_SIZE_K(1984)>; + }; + slot1_partition: partition@200000 { + label = "image-1"; + reg = <0x00200000 DT_SIZE_K(1984)>; + }; + scratch_partition: partition@3f0000 { + label = "image-scratch"; + reg = <0x003f0000 DT_SIZE_K(64)>; + }; + }; +}; + &lpuart1 { status = "okay"; current-speed = <115200>; From 5e7050e9a58d47102158acb22d5eb9ec41103598 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 19:50:15 -0500 Subject: [PATCH 2/5] boards: arm: Add mcuboot and flash storage partitions to mimxrt1060_evk Adds flash partitions and chosen nodes to the mimxrt1060_evk device tree to support mcuboot and storage on the external QSPI flash. This flash is rated for 100K minimum program-erase cycles per sector, therefore this partition configuration supports approximately 100K / (3072/128) = 4167 upgrades. Also enables FlexSPI flash driver XIP mode support on this board to support mcuboot. Signed-off-by: Maureen Helm --- boards/arm/mimxrt1060_evk/Kconfig.defconfig | 6 ++++ boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts | 36 +++++++++++++++++++ .../mimxrt1060_evk_hyperflash.dts | 9 +++++ 3 files changed, 51 insertions(+) diff --git a/boards/arm/mimxrt1060_evk/Kconfig.defconfig b/boards/arm/mimxrt1060_evk/Kconfig.defconfig index bf590387b978ce..0e9e1f8d64ed41 100644 --- a/boards/arm/mimxrt1060_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1060_evk/Kconfig.defconfig @@ -16,6 +16,12 @@ endchoice config DISK_DRIVER_SDMMC default y if DISK_DRIVERS +config FLASH_MCUX_FLEXSPI_NOR + default y if FLASH && BOARD_MIMXRT1060_EVK + +config FLASH_MCUX_FLEXSPI_XIP + default y if FLASH && BOARD_MIMXRT1060_EVK + config I2C default y if KSCAN diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts index df7ecac60d19a3..b814b6721b1504 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts @@ -20,6 +20,9 @@ }; chosen { + zephyr,flash-controller = &flexspi; + zephyr,flash = &is25wp064; + zephyr,code-partition = &slot0_partition; zephyr,sram = &sdram0; zephyr,itcm = &itcm; zephyr,dtcm = &dtcm; @@ -92,6 +95,10 @@ arduino_serial: &lpuart3 {}; &flexspi { + status = "okay"; + ahb-prefetch; + ahb-read-addr-opt; + rx-clock-source = <1>; reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>; is25wp064: is25wp064@0 { compatible = "nxp,imx-flexspi-nor"; @@ -101,6 +108,35 @@ arduino_serial: &lpuart3 {}; spi-max-frequency = <133000000>; status = "okay"; jedec-id = [9d 70 17]; + erase-block-size = <4096>; + write-block-size = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; + }; + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 DT_SIZE_M(3)>; + }; + slot1_partition: partition@310000 { + label = "image-1"; + reg = <0x00310000 DT_SIZE_M(3)>; + }; + scratch_partition: partition@610000 { + label = "image-scratch"; + reg = <0x00610000 DT_SIZE_K(128)>; + }; + storage_partition: partition@630000 { + label = "storage"; + reg = <0x00630000 DT_SIZE_K(1856)>; + }; + }; }; }; diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts index ef193819db9548..37324a290c72e3 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk_hyperflash.dts @@ -7,6 +7,15 @@ #include "mimxrt1060_evk.dts" /delete-node/ &is25wp064; + +/ { + chosen { + /delete-property/ zephyr,flash-controller; + /delete-property/ zephyr,flash; + /delete-property/ zephyr,code-partition; + }; +}; + &flexspi { reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(64)>; s26ks512s0: s26ks512s@0 { From 17b4af328ba4677b75bad244b54e8d6d4bb27d92 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 20:44:54 -0500 Subject: [PATCH 3/5] boards: arm: Document flash driver support on mimxrt106x_evk boards Documents QSPI flash driver support on mimxrt1060_evk and mimxrt1064_evk boards. Signed-off-by: Maureen Helm --- boards/arm/mimxrt1060_evk/doc/index.rst | 2 ++ boards/arm/mimxrt1064_evk/doc/index.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/boards/arm/mimxrt1060_evk/doc/index.rst b/boards/arm/mimxrt1060_evk/doc/index.rst index 95936a9fff3113..6d15e0d9ea7f9c 100644 --- a/boards/arm/mimxrt1060_evk/doc/index.rst +++ b/boards/arm/mimxrt1060_evk/doc/index.rst @@ -96,6 +96,8 @@ features: +-----------+------------+-------------------------------------+ | DISPLAY | on-chip | display | +-----------+------------+-------------------------------------+ +| FLASH | on-chip | QSPI flash | ++-----------+------------+-------------------------------------+ | GPIO | on-chip | gpio | +-----------+------------+-------------------------------------+ | I2C | on-chip | i2c | diff --git a/boards/arm/mimxrt1064_evk/doc/index.rst b/boards/arm/mimxrt1064_evk/doc/index.rst index aae83997c447eb..9d3a39fa2f6e8d 100644 --- a/boards/arm/mimxrt1064_evk/doc/index.rst +++ b/boards/arm/mimxrt1064_evk/doc/index.rst @@ -96,6 +96,8 @@ features: +-----------+------------+-------------------------------------+ | DISPLAY | on-chip | display | +-----------+------------+-------------------------------------+ +| FLASH | on-chip | QSPI flash | ++-----------+------------+-------------------------------------+ | GPIO | on-chip | gpio | +-----------+------------+-------------------------------------+ | SDHC | on-chip | disk access | From aa8d16b4646b0d754d0280e17de8a46d20dbb6d5 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 20:48:28 -0500 Subject: [PATCH 4/5] samples: mgmt: Extend smp_svr sample to mimxrt106x_evk boards Adds mimxrt1060_evk and mimxrt1064_evk boards to the platform_allow list for the smp_svr sample application. Signed-off-by: Maureen Helm --- samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml index b941f6bc815a26..642992c43e2351 100644 --- a/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml +++ b/samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml @@ -27,7 +27,7 @@ tests: platform_allow: nrf52840dk_nrf52840 sample.mcumg.smp_svr.shell: extra_args: OVERLAY_CONFIG="overlay-shell.conf" - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk_nrf52840 mimxrt1060_evk mimxrt1064_evk sample.mcumg.smp_svr.shell_mgmt: extra_args: OVERLAY_CONFIG="overlay-shell-mgmt.conf" platform_allow: nrf52840dk_nrf52840 From d56af8183de74bcdedb3eee41ce3e37ceaf3c1b5 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Mon, 3 May 2021 16:44:16 -0500 Subject: [PATCH 5/5] samples: fs: Extend littlefs sample to mimxrt1060_evk board Adds the mimxrt1060_evk board to the platform_allow list for the littlefs sample application. Signed-off-by: Maureen Helm --- samples/subsys/fs/littlefs/sample.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/subsys/fs/littlefs/sample.yaml b/samples/subsys/fs/littlefs/sample.yaml index 8af39843e51dd0..a4f6bb47b8dd5c 100644 --- a/samples/subsys/fs/littlefs/sample.yaml +++ b/samples/subsys/fs/littlefs/sample.yaml @@ -4,5 +4,5 @@ tests: sample.filesystem.littlefs: build_only: true platform_allow: nrf52840dk_nrf52840 particle_xenon disco_l475_iot1 - mimxrt1064_evk qemu_x86 native_posix + mimxrt1060_evk mimxrt1064_evk qemu_x86 native_posix tags: filesystem