From 251e730e21f06b011e7117e4ab0e5ce271f3c642 Mon Sep 17 00:00:00 2001 From: Xabier Marquiegui Date: Thu, 9 Sep 2021 17:53:11 +0200 Subject: [PATCH] boards: arm: Add mcuboot flash partitions to mimxrt1020_evk Adds flash partitions and chosen nodes to the mimxrt1020_evk device tree to support mcuboot on the internal QSPI flash. Also enables FlexSPI flash driver XIP mode support on this board to support mcuboot. Signed-off-by: Xabier Marquiegui --- boards/arm/mimxrt1020_evk/Kconfig.defconfig | 6 ++++ boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts | 33 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/boards/arm/mimxrt1020_evk/Kconfig.defconfig b/boards/arm/mimxrt1020_evk/Kconfig.defconfig index 2e610e2d3e0..a877d43833b 100644 --- a/boards/arm/mimxrt1020_evk/Kconfig.defconfig +++ b/boards/arm/mimxrt1020_evk/Kconfig.defconfig @@ -15,6 +15,12 @@ endchoice config DISK_DRIVER_SDMMC default y if DISK_DRIVERS +config FLASH_MCUX_FLEXSPI_NOR + default y if FLASH && BOARD_MIMXRT1020_EVK + +config FLASH_MCUX_FLEXSPI_XIP + default y if FLASH && BOARD_MIMXRT1020_EVK + if NETWORKING config NET_L2_ETHERNET diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts index 91dde067505..18aa9bcb837 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts @@ -18,6 +18,9 @@ }; chosen { + zephyr,flash-controller = &flexspi; + zephyr,flash = &is25wp064; + zephyr,code-partition = &slot0_partition; zephyr,sram = &sdram0; zephyr,itcm = &itcm; zephyr,dtcm = &dtcm; @@ -80,6 +83,7 @@ arduino_serial: &lpuart2 {}; &flexspi { + status = "okay"; reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>; is25wp064: is25wp064@0 { compatible = "nxp,imx-flexspi-nor"; @@ -89,6 +93,35 @@ arduino_serial: &lpuart2 {}; 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)>; + }; + }; }; };