From 62e3298bed36f253bfc4a4bd08f9f46d22c47824 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 May 2021 19:50:15 -0500 Subject: [PATCH] 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 bf590387b97..0e9e1f8d64e 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 df7ecac60d1..b814b6721b1 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 ef193819db9..37324a290c7 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 {