1#
2# Copyright 2023 NXP
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7
8if(CONFIG_NXP_IMX_RT_BOOT_HEADER)
9  zephyr_library()
10  if(NOT DEFINED CONFIG_BOARD_MIMXRT1040_EVK)
11    message(WARNING "It appears you are using the board definition for "
12     "the MIMXRT1040-EVK, but targeting a custom board. You may need to "
13     "update your flash configuration or device configuration data blocks")
14  endif()
15  set(RT1040_BOARD_DIR
16    "${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/boards/evkmimxrt1040")
17  if(CONFIG_BOOT_FLEXSPI_NOR)
18    # Include flash configuration block for RT1040 EVK from NXP's HAL.
19    # This configuration block may need modification if another flash chip is
20    # used on your custom board. See NXP AN12238 for more information.
21    zephyr_compile_definitions(XIP_BOOT_HEADER_ENABLE=1)
22    zephyr_compile_definitions(BOARD_FLASH_SIZE=CONFIG_FLASH_SIZE*1024)
23    zephyr_library_sources(${RT1040_BOARD_DIR}/xip/evkmimxrt1040_flexspi_nor_config.c)
24    zephyr_library_include_directories(${RT1040_BOARD_DIR}/xip)
25  endif()
26  if(CONFIG_DEVICE_CONFIGURATION_DATA)
27    # Include device configuration data block for RT1040 EVK from NXP's HAL.
28    # This configuration block may need modification if another SDRAM chip
29    # is used on your custom board.
30    zephyr_compile_definitions(XIP_BOOT_HEADER_DCD_ENABLE=1)
31    zephyr_library_sources(${RT1040_BOARD_DIR}/dcd.c)
32  else()
33    if(CONFIG_SRAM_BASE_ADDRESS EQUAL 0x80000000)
34      message(WARNING "You are using SDRAM as RAM but no device "
35        "configuration data (DCD) is included. This configuration may not boot")
36    endif()
37  endif()
38endif()
39
40if(CONFIG_MCUX_GPT_TIMER)
41  message(WARNING "You appear to be using the GPT hardware timer. "
42    "This timer will enable lower power modes, but at the cost of reduced "
43    "hardware timer resolution")
44endif()
45