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