1# Copyright (c) 2023 Intel Corporation.
2#
3# SPDX-License-Identifier: BSD-3-Clause
4
5if(CONFIG_INTEL_HAL)
6
7  set(BSP_SEDI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../bsp_sedi)
8
9  zephyr_interface_library_named(BSP_SEDI)
10  target_link_libraries(zephyr_interface INTERFACE BSP_SEDI)
11  target_include_directories(BSP_SEDI INTERFACE ${BSP_SEDI_SRC}/include/driver)
12
13  zephyr_library_named(modules_intel_hal)
14  zephyr_library_link_libraries(BSP_SEDI)
15
16  zephyr_library_sources(${BSP_SEDI_SRC}/drivers/rtc/sedi_rtc.c)
17  zephyr_library_sources_ifdef(CONFIG_I2C_SEDI ${BSP_SEDI_SRC}/drivers/i2c/sedi_i2c_dw_apb_200a.c)
18  zephyr_library_sources_ifdef(CONFIG_UART_SEDI ${BSP_SEDI_SRC}/drivers/usart/sedi_dw_uart.c)
19  zephyr_library_sources_ifdef(CONFIG_GPIO_SEDI ${BSP_SEDI_SRC}/drivers/gpio/sedi_gpio.c)
20  zephyr_library_sources_ifdef(CONFIG_SPI_SEDI ${BSP_SEDI_SRC}/drivers/spi/sedi_spi_dw_apb.c)
21  zephyr_library_sources_ifdef(CONFIG_DMA_SEDI ${BSP_SEDI_SRC}/drivers/dma/sedi_dma_ann_1p0.c)
22  zephyr_library_sources_ifdef(CONFIG_IPM_SEDI ${BSP_SEDI_SRC}/drivers/ipc/sedi_ipc.c)
23  zephyr_library_sources_ifdef(CONFIG_HPET_TIMER ${BSP_SEDI_SRC}/drivers/hpet/sedi_hpet.c)
24
25  if(DEFINED CONFIG_SOC_FAMILY_INTEL_ISH)
26      zephyr_library_sources_ifdef(CONFIG_PM ${BSP_SEDI_SRC}/soc/intel_ish/pm/ish_pm.c)
27      zephyr_library_sources_ifdef(CONFIG_PM ${BSP_SEDI_SRC}/soc/intel_ish/pm/ish_dma.c)
28      zephyr_library_sources_ifdef(CONFIG_PM ${BSP_SEDI_SRC}/soc/intel_ish/pm/aon/aon_task.c)
29      zephyr_library_sources_ifdef(CONFIG_PM ${BSP_SEDI_SRC}/soc/intel_ish/pm/aon/ipapg.S)
30  endif()
31
32  target_include_directories(BSP_SEDI INTERFACE ${BSP_SEDI_SRC}/soc/common/include)
33
34  set(BSP_SEDI_SOC_DIR ${BSP_SEDI_SRC}/soc/${SOC_FAMILY})
35  target_include_directories(BSP_SEDI INTERFACE ${BSP_SEDI_SOC_DIR}/include)
36  if(EXISTS ${BSP_SEDI_SOC_DIR}/sedi_soc.c)
37      zephyr_library_sources(${BSP_SEDI_SOC_DIR}/sedi_soc.c)
38  endif()
39
40endif()
41