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