Skip to content

Commit

Permalink
boards: nxp: mimxrt1180_evk: add flexspi1 support
Browse files Browse the repository at this point in the history
USE_HYPERRAM macro defined shouldn't be placed under
CONFIG_BOOT_FLEXSPI_NOR.

Add flexspi1 pinmux pinctrl and flash partitions

Add flash partitions and correct flash parameter.

This commit was tested with samples: flash_shell on cm33/cm7 cores

Signed-off-by: Lucien Zhao <[email protected]>
  • Loading branch information
lucien-nxp committed Sep 18, 2024
1 parent 7f04cc9 commit 1f395f2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
7 changes: 4 additions & 3 deletions boards/nxp/mimxrt1180_evk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ if(CONFIG_NXP_IMXRT_BOOT_HEADER)
# used on your custom board.
zephyr_compile_definitions(XIP_EXTERNAL_FLASH=1)
zephyr_compile_definitions(XIP_BOOT_HEADER_ENABLE=1)
if(CONFIG_EXTERNAL_MEM_CONFIG_DATA AND CONFIG_NXP_IMX_EXTERNAL_HYPERRAM)
zephyr_compile_definitions(USE_HYPERRAM)
endif()
zephyr_library_sources(${RT1180_BOARD_DIR}/xip/evkmimxrt1180_flexspi_nor_config.c)
zephyr_library_include_directories(${RT1180_BOARD_DIR}/xip)
zephyr_library_include_directories(${RT1180_BOARD_DIR})
endif()
if(CONFIG_EXTERNAL_MEM_CONFIG_DATA AND CONFIG_NXP_IMX_EXTERNAL_HYPERRAM)
zephyr_compile_definitions(USE_HYPERRAM)
zephyr_library_sources(${RT1180_BOARD_DIR}/xip/evkmimxrt1180_flexspi_nor_config.c)
endif()
endif()
2 changes: 2 additions & 0 deletions boards/nxp/mimxrt1180_evk/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ configuration supports the following hardware features:
+-----------+------------+-------------------------------------+
| ACMP | on-chip | analog comparator |
+-----------+------------+-------------------------------------+
| FLEXSPI | on-chip | flash programming |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
:zephyr_file:`boards/nxp/mimxrt1180_evk/mimxrt1180_evk_mimxrt1189_cm33_defconfig`
Expand Down
14 changes: 14 additions & 0 deletions boards/nxp/mimxrt1180_evk/mimxrt1180_evk-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,18 @@
input-enable;
};
};

pinmux_flexspi1: pinmux_flexspi1 {
group0 {
pinmux = <&iomuxc_gpio_sd_b2_05_flexspi1_b_dqs>,
<&iomuxc_gpio_sd_b2_06_flexspi1_b_ss0_b>,
<&iomuxc_gpio_sd_b2_07_flexspi1_b_sclk>,
<&iomuxc_gpio_sd_b2_08_flexspi1_b_data0>,
<&iomuxc_gpio_sd_b2_09_flexspi1_b_data1>,
<&iomuxc_gpio_sd_b2_10_flexspi1_b_data2>,
<&iomuxc_gpio_sd_b2_11_flexspi1_b_data3>;
bias-pull-down;
input-enable;
};
};
};
39 changes: 35 additions & 4 deletions boards/nxp/mimxrt1180_evk/mimxrt1180_evk.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,51 @@
status = "okay";
};

&flexspi1 {
&flexspi {
pinctrl-0 = <&pinmux_flexspi1>;
pinctrl-names = "default";
};

&flexspi {
status = "okay";
ahb-prefetch;
ahb-read-addr-opt;
rx-clock-source = <1>;
w25q128jw: w25q128jw@0 {
compatible = "nxp,imx-flexspi-nor";
size = <134217728>;
reg = <0>;
size = <DT_SIZE_M(16*8)>;
reg = <2>;
spi-max-frequency = <133000000>;
status = "okay";
jedec-id = [ef 80 18];
jedec-id = [ef 60 18];
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(128)>;
};
/* The MCUBoot swap-move algorithm uses the last 3 sectors
* of the primary slot0 for swap status and move.
*/
slot0_partition: partition@20000 {
label = "image-0";
reg = <0x00020000 (DT_SIZE_M(7) + DT_SIZE_K(12))>;
};
slot1_partition: partition@723000 {
label = "image-1";
reg = <0x00723000 DT_SIZE_M(7)>;
};
storage_partition: partition@E23000 {
label = "storage";
reg = <0x00E23000 (DT_SIZE_M(2) - DT_SIZE_K(140))>;
};
};
};
};

Expand Down

0 comments on commit 1f395f2

Please sign in to comment.