1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_include_directories(.)
4zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_MEC172X
5  soc_i2c.c
6)
7zephyr_library_sources_ifdef(CONFIG_HAS_MEC5_HAL
8  soc_cmn_init.c
9)
10
11if (DEFINED CONFIG_MCHP_HEADER_VERBOSE_OUTPUT)
12    set(MCHP_HEADER_VERBOSE_OPTION "-v")
13endif()
14
15if (DEFINED CONFIG_MCHP_MEC_UNSIGNED_HEADER)
16  set(MCHP_MEC_BIN_NAME ${CONFIG_KERNEL_BIN_NAME}.mchp.bin)
17  set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
18    COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/soc/microchip/mec/common/spigen/mec_spi_gen.py
19    -i ${KERNEL_BIN_NAME}
20    -o ${MCHP_MEC_BIN_NAME}
21    -c ${CONFIG_MCHP_MEC_HEADER_CHIP}
22    -s ${CONFIG_MCHP_MEC_HEADER_FLASH_SIZE}
23    -f ${CONFIG_MCHP_MEC_HEADER_SPI_FREQ_MHZ}
24    -r ${CONFIG_MCHP_MEC_HEADER_SPI_READ_MODE}
25    -m ${CONFIG_MCHP_MEC_HEADER_FLASH_SPI_MODE}
26    --drvstr ${CONFIG_MCHP_MEC_HEADER_SPI_DRVSTR}
27    --slewrate ${CONFIG_MCHP_MEC_HEADER_SPI_SLEW_RATE}
28    ${MCHP_HEADER_VERBOSE_OPTION}
29  )
30endif()
31