|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | + |
| 3 | +if(CONFIG_SOC_SERIES_ESP32H2) |
| 4 | + |
| 5 | + zephyr_compile_options(-fstrict-volatile-bitfields) |
| 6 | + zephyr_compile_definitions_ifndef(CONFIG_MCUBOOT CONFIG_APP_BUILD_USE_FLASH_SECTIONS) |
| 7 | + zephyr_compile_definitions_ifndef(asm asm=__asm__) |
| 8 | + |
| 9 | + zephyr_compile_definitions(CONFIG_IDF_TARGET_ARCH_RISCV) |
| 10 | + |
| 11 | + if(CONFIG_MCUBOOT) |
| 12 | + zephyr_compile_options(-fdump-rtl-expand) |
| 13 | + endif() |
| 14 | + |
| 15 | + zephyr_include_directories( |
| 16 | + include |
| 17 | + ../port/include |
| 18 | + ../common/include |
| 19 | + |
| 20 | + ../../components/efuse/include |
| 21 | + ../../components/efuse/private_include |
| 22 | + ../../components/efuse/${CONFIG_SOC_SERIES}/include |
| 23 | + ../../components/efuse/${CONFIG_SOC_SERIES}/private_include |
| 24 | + |
| 25 | + ../../components/esp_common/include |
| 26 | + |
| 27 | + ../../components/esp_hw_support/dma |
| 28 | + ../../components/esp_hw_support/include |
| 29 | + ../../components/esp_hw_support/include/esp_private |
| 30 | + ../../components/esp_hw_support/include/hal |
| 31 | + ../../components/esp_hw_support/include/soc |
| 32 | + ../../components/esp_hw_support/include/soc/${CONFIG_SOC_SERIES} |
| 33 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES} |
| 34 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/private_include |
| 35 | + ../../components/esp_hw_support/port/include |
| 36 | + ../../components/esp_rom/${CONFIG_SOC_SERIES} |
| 37 | + ../../components/esp_rom/${CONFIG_SOC_SERIES}/ld |
| 38 | + ../../components/esp_rom/include/ |
| 39 | + ../../components/esp_rom/include/${CONFIG_SOC_SERIES} |
| 40 | + |
| 41 | + ../../components/esp_system/include |
| 42 | + ../../components/esp_system/include/esp_private |
| 43 | + ../../components/esp_system/port/include |
| 44 | + ../../components/esp_system/port/include/private/esp_private |
| 45 | + ../../components/esp_system/port/include/private |
| 46 | + |
| 47 | + ../../components/hal/${CONFIG_SOC_SERIES}/include |
| 48 | + ../../components/hal/include |
| 49 | + ../../components/hal/platform_port/include |
| 50 | + |
| 51 | + ../../components/log/include |
| 52 | + |
| 53 | + ../../components/soc/${CONFIG_SOC_SERIES}/include |
| 54 | + ../../components/soc/${CONFIG_SOC_SERIES}/ld |
| 55 | + ../../components/soc/include |
| 56 | + |
| 57 | + ../../components/riscv/${CONFIG_SOC_SERIES}/include |
| 58 | + ../../components/riscv/include |
| 59 | + ../../components/riscv/include/esp_private |
| 60 | + ../../components/riscv/include/xtensa |
| 61 | + |
| 62 | + ../../components/esp_timer/include |
| 63 | + ../../components/esp_timer/private_include |
| 64 | + |
| 65 | + ../../components/driver/include |
| 66 | + ../../components/driver/deprecated |
| 67 | + ../../components/driver/gpio/include |
| 68 | + ../../components/driver/uart/include |
| 69 | + ../../components/driver/spi/include |
| 70 | + |
| 71 | + ../../components/spi_flash/include |
| 72 | + ../../components/spi_flash/include/spi_flash |
| 73 | + |
| 74 | + ../../components/esp_pm/include |
| 75 | + |
| 76 | + ../../components/bootloader_support/include |
| 77 | + ../../components/bootloader_support/private_include |
| 78 | + ../../components/bootloader_support/bootloader_flash/include |
| 79 | + |
| 80 | + ../../components/heap/include |
| 81 | + |
| 82 | + ../../components/esp_mm/include |
| 83 | + |
| 84 | + ../../components/esp_phy/include |
| 85 | + ../../components/esp_phy/include/esp_private |
| 86 | + ../../components/esp_phy/${CONFIG_SOC_SERIES}/include |
| 87 | + ../../components/esp_event/include |
| 88 | + |
| 89 | + ../port/include/boot |
| 90 | + ) |
| 91 | + |
| 92 | + zephyr_link_libraries( |
| 93 | + gcc |
| 94 | + -T${CMAKE_CURRENT_SOURCE_DIR}/src/linker/${CONFIG_SOC_SERIES}.rom.alias.ld |
| 95 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.ld |
| 96 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.api.ld |
| 97 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.newlib.ld |
| 98 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.libgcc.ld |
| 99 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.version.ld |
| 100 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.wdt.ld |
| 101 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../components/soc/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.peripherals.ld |
| 102 | + -T${CMAKE_CURRENT_SOURCE_DIR}/../../tools/flasher_stub/ld/rom_32h2.ld |
| 103 | + ) |
| 104 | + |
| 105 | + zephyr_compile_definitions(ESP_PLATFORM) |
| 106 | + |
| 107 | + zephyr_sources( |
| 108 | + ../../components/efuse/src/esp_efuse_api.c |
| 109 | + ../../components/efuse/src/esp_efuse_utility.c |
| 110 | + ../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_table.c |
| 111 | + ../../components/efuse/${CONFIG_SOC_SERIES}/esp_efuse_utility.c |
| 112 | + ../../components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c |
| 113 | + ) |
| 114 | + |
| 115 | + if(CONFIG_SOC_FLASH_ESP32 OR NOT CONFIG_BOOTLOADER_MCUBOOT) |
| 116 | + zephyr_sources( |
| 117 | + ../../components/esp_mm/esp_mmu_map.c |
| 118 | + ../../components/esp_mm/port/${CONFIG_SOC_SERIES}/ext_mem_layout.c |
| 119 | + ../../components/bootloader_support/src/flash_encrypt.c |
| 120 | + ../../components/esp_hw_support/esp_gpio_reserve.c |
| 121 | + ../../components/hal/cache_hal.c |
| 122 | + ../../components/hal/mmu_hal.c |
| 123 | + ../../components/hal/spi_flash_encrypt_hal_iram.c |
| 124 | + ../../components/hal/spi_flash_hal.c |
| 125 | + ../../components/hal/spi_flash_hal_iram.c |
| 126 | + ../../components/hal/spi_flash_hal_gpspi.c |
| 127 | + ../../components/spi_flash/esp_flash_api.c |
| 128 | + ../../components/spi_flash/esp_flash_spi_init.c |
| 129 | + ../../components/spi_flash/flash_mmap.c |
| 130 | + ../../components/spi_flash/flash_ops.c |
| 131 | + ../../components/spi_flash/memspi_host_driver.c |
| 132 | + ../../components/spi_flash/spi_flash_chip_boya.c |
| 133 | + ../../components/spi_flash/spi_flash_chip_drivers.c |
| 134 | + ../../components/spi_flash/spi_flash_chip_gd.c |
| 135 | + ../../components/spi_flash/spi_flash_chip_generic.c |
| 136 | + ../../components/spi_flash/spi_flash_chip_issi.c |
| 137 | + ../../components/spi_flash/spi_flash_chip_mxic.c |
| 138 | + ../../components/spi_flash/spi_flash_chip_mxic_opi.c |
| 139 | + ../../components/spi_flash/spi_flash_chip_th.c |
| 140 | + ../../components/spi_flash/spi_flash_chip_winbond.c |
| 141 | + ../../components/spi_flash/spi_flash_os_func_noos.c |
| 142 | + ../../components/spi_flash/spi_flash_os_func_app.c |
| 143 | + ) |
| 144 | + endif() |
| 145 | + |
| 146 | + if (CONFIG_MCUBOOT) |
| 147 | + zephyr_sources( |
| 148 | + ../port/boot/esp_image_loader.c |
| 149 | + ) |
| 150 | + endif() |
| 151 | + |
| 152 | + if (CONFIG_MCUBOOT OR NOT CONFIG_BOOTLOADER_MCUBOOT) |
| 153 | + zephyr_include_directories( |
| 154 | + ../../components/esp_rom/${CONFIG_SOC_SERIES} |
| 155 | + ) |
| 156 | + |
| 157 | + zephyr_sources( |
| 158 | + ../../components/bootloader_support/src/bootloader_clock_init.c |
| 159 | + ../../components/hal/mpu_hal.c |
| 160 | + ../../components/bootloader_support/bootloader_flash/src/flash_qio_mode.c |
| 161 | + ../common/console_init.c |
| 162 | + ../common/soc_init.c |
| 163 | + ) |
| 164 | + endif() |
| 165 | + |
| 166 | + zephyr_sources_ifdef( |
| 167 | + CONFIG_SOC_ESP32H2 |
| 168 | + |
| 169 | + ../../components/soc/${CONFIG_SOC_SERIES}/gpio_periph.c |
| 170 | + ../../components/soc/${CONFIG_SOC_SERIES}/rtc_io_periph.c |
| 171 | + ../../components/soc/${CONFIG_SOC_SERIES}/temperature_sensor_periph.c |
| 172 | + |
| 173 | + ../../components/esp_hw_support/adc_share_hw_ctrl.c |
| 174 | + ../../components/esp_hw_support/cpu.c |
| 175 | + ../../components/esp_hw_support/clk_ctrl_os.c |
| 176 | + ../../components/esp_hw_support/hw_random.c |
| 177 | + ../../components/esp_hw_support/esp_clk.c |
| 178 | + ../../components/esp_hw_support/mac_addr.c |
| 179 | + ../../components/esp_hw_support/modem_clock.c |
| 180 | + ../../components/esp_hw_support/periph_ctrl.c |
| 181 | + ../../components/esp_hw_support/regi2c_ctrl.c |
| 182 | + ../../components/esp_hw_support/sar_periph_ctrl_common.c |
| 183 | + ../../components/esp_hw_support/sleep_modes.c |
| 184 | + ../../components/esp_hw_support/sleep_retention.c |
| 185 | + ../../components/esp_hw_support/port/esp_clk_tree_common.c |
| 186 | + ../../components/esp_hw_support/port/regdma_link.c |
| 187 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/esp_cpu_intr.c |
| 188 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/esp_clk_tree.c |
| 189 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/rtc_clk.c |
| 190 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/rtc_clk_init.c |
| 191 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/rtc_time.c |
| 192 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/sar_periph_ctrl.c |
| 193 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/systimer.c |
| 194 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/pmu_init.c |
| 195 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/pmu_param.c |
| 196 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/pmu_sleep.c |
| 197 | + ../../components/esp_hw_support/port/${CONFIG_SOC_SERIES}/cpu_region_protect.c |
| 198 | + ../../components/esp_rom/patches/esp_rom_crc.c |
| 199 | + ../../components/esp_rom/patches/esp_rom_sys.c |
| 200 | + ../../components/esp_rom/patches/esp_rom_uart.c |
| 201 | + ../../components/esp_rom/patches/esp_rom_spiflash.c |
| 202 | + ../../components/esp_rom/patches/esp_rom_efuse.c |
| 203 | + ../../components/esp_rom/patches/esp_rom_gpio.c |
| 204 | + ../../components/esp_rom/patches/esp_rom_systimer.c |
| 205 | + ../../components/esp_rom/patches/esp_rom_wdt.c |
| 206 | + ../../components/esp_rom/patches/esp_rom_regi2c_esp32h2.c |
| 207 | + |
| 208 | + ../../components/esp_system/port/soc/${CONFIG_SOC_SERIES}/clk.c |
| 209 | + ../../components/esp_system/port/soc/${CONFIG_SOC_SERIES}/system_internal.c |
| 210 | + ../../components/esp_system/port/soc/${CONFIG_SOC_SERIES}/reset_reason.c |
| 211 | + ../../components/esp_system/esp_err.c |
| 212 | + |
| 213 | + ../../components/esp_timer/src/ets_timer_legacy.c |
| 214 | + ../../components/esp_timer/src/esp_timer.c |
| 215 | + ../../components/esp_timer/src/esp_timer_etm.c |
| 216 | + ../../components/esp_timer/src/esp_timer_impl_common.c |
| 217 | + ../../components/esp_timer/src/esp_timer_impl_systimer.c |
| 218 | + ../../components/esp_timer/src/system_time.c |
| 219 | + |
| 220 | + ../../components/hal/efuse_hal.c |
| 221 | + ../../components/hal/systimer_hal.c |
| 222 | + ../../components/hal/wdt_hal_iram.c |
| 223 | + ../../components/hal/${CONFIG_SOC_SERIES}/clk_tree_hal.c |
| 224 | + ../../components/hal/${CONFIG_SOC_SERIES}/efuse_hal.c |
| 225 | + ../../components/hal/${CONFIG_SOC_SERIES}/modem_clock_hal.c |
| 226 | + ../../components/hal/lp_timer_hal.c |
| 227 | + |
| 228 | + ../../components/log/log_noos.c |
| 229 | + ../../components/log/log.c |
| 230 | + |
| 231 | + ../../components/riscv/interrupt.c |
| 232 | + ../../components/riscv/instruction_decode.c |
| 233 | + |
| 234 | + ../port/heap/heap_caps_zephyr.c |
| 235 | + ../port/host_flash/cache_utils.c |
| 236 | + ../port/bootloader/bootloader_flash.c |
| 237 | + |
| 238 | + ../common/flash_init.c |
| 239 | + ../common/esp_restart.c |
| 240 | + |
| 241 | + src/stubs.c |
| 242 | + src/soc_random.c |
| 243 | + src/soc_init.c |
| 244 | + src/soc_flash_init.c |
| 245 | + ) |
| 246 | + |
| 247 | + zephyr_sources_ifdef( |
| 248 | + CONFIG_UART_ESP32 |
| 249 | + ../../components/hal/uart_hal.c |
| 250 | + ../../components/hal/uart_hal_iram.c |
| 251 | + ../../components/soc/${CONFIG_SOC_SERIES}/uart_periph.c |
| 252 | + ) |
| 253 | + |
| 254 | + zephyr_link_libraries_ifdef(CONFIG_NEWLIB_LIBC c) |
| 255 | + |
| 256 | +endif() |
0 commit comments