modules: hal_infineon: Added blob support for CM0+ images

Initial blob support for PSoC6 CM0+ images

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
This commit is contained in:
Nazar Palamar 2023-01-31 13:02:40 +02:00 committed by Carles Cufí
parent a8cc50a712
commit 423a085fe3
3 changed files with 51 additions and 1 deletions

View file

@ -19,7 +19,15 @@ if (CONFIG_SOC_FAMILY_INFINEON_CAT1A OR CONFIG_SOC_FAMILY_PSOC6)
add_subdirectory(mtb-pdl-cat1)
endif()
## Add mtb-hal-cat1 sources for CAT1 devices
if (CONFIG_SOC_FAMILY_INFINEON_CAT1A)
## Add mtb-hal-cat1 sources for CAT1 devices
add_subdirectory(mtb-hal-cat1)
## Add catcm0p sleep images for CM0 Devices
if(CONFIG_SOC_PSOC6_CM0P_IMAGE_SLEEP)
add_subdirectory(cat1cm0p)
endif()
endif()

View file

@ -0,0 +1,37 @@
# Copyright (c) 2022 Cypress Semiconductor Corporation.
#
# SPDX-License-Identifier: Apache-2.0
set(hal_dir ${ZEPHYR_HAL_INFINEON_MODULE_DIR})
set(hal_cat1cm0p_dir ${hal_dir}/cat1cm0p)
set(hal_blobs_dir ${hal_dir}/zephyr/blobs/img/cat1cm0p/COMPONENT_CM0P_SLEEP)
set(blob_gen_dir ${ZEPHYR_BINARY_DIR}/include/generated)
set(blob_gen_inc_file ${blob_gen_dir}/psoc6_cm0p_sleep.bin.inc)
if(CONFIG_SOC_DIE_PSOC6_01)
set(blob_bin_file ${hal_blobs_dir}/psoc6_01_cm0p_sleep.bin)
endif()
if(CONFIG_SOC_DIE_PSOC6_02)
set(blob_bin_file ${hal_blobs_dir}/psoc6_02_cm0p_sleep.bin)
endif()
if(CONFIG_SOC_DIE_PSOC6_03)
set(blob_bin_file ${hal_blobs_dir}/psoc6_03_cm0p_sleep.bin)
endif()
if(CONFIG_SOC_DIE_PSOC6_04)
set(blob_bin_file ${hal_blobs_dir}/psoc6_04_cm0p_sleep.bin)
endif()
# Generate Include binaries and add source of psoc6_cm0p_sleep.c
if(EXISTS ${blob_bin_file})
# Generate Include binaries
generate_inc_file_for_target(app ${blob_bin_file} ${blob_gen_inc_file})
# psoc6_cm0p_sleep.c - template c-array file, which include generated
# blob include file.
zephyr_library_sources(${hal_cat1cm0p_dir}/COMPONENT_CM0P_SLEEP/psoc6_cm0p_sleep.c)
else()
message(WARNING "Can't find CM0+ binaries, please execute: \'west blobs fetch hal_infineon\' ")
endif()

View file

@ -6,6 +6,11 @@ set(hal_dir ${ZEPHYR_HAL_INFINEON_MODULE_DIR}/mtb-hal-cat1)
set(hal_psoc6_dir ${hal_dir}/COMPONENT_PSOC6HAL)
set(hal_psoc6_cat1a_dir ${hal_dir}/COMPONENT_PSOC6HAL/COMPONENT_CAT1A)
# PSoC 6 family defines
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1A COMPONENT_CAT1A)
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1 COMPONENT_CAT1)
zephyr_compile_definitions_ifdef(CONFIG_SOC_FAMILY_INFINEON_CAT1 CY_USING_HAL)
# Add mtb-hal-cat1
zephyr_include_directories(${hal_dir}/include)
zephyr_include_directories(${hal_dir}/COMPONENT_PSOC6HAL/include)