From 6a9dc2ae57176388c344fb67505c9b8a8694a907 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 19:19:29 -0500 Subject: [PATCH] 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 b5fbbfb0e1a..f49f2944c51 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 13e0399c7d5..dda42d0b7cf 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>;