diff --git a/libcaliptra/zephyr/CMakeLists.txt b/libcaliptra/zephyr/CMakeLists.txt new file mode 100644 index 0000000000..d6dcb262e9 --- /dev/null +++ b/libcaliptra/zephyr/CMakeLists.txt @@ -0,0 +1,15 @@ +# Licensed under the Apache-2.0 license + +if (CONFIG_LIBCALIPTRA) + +zephyr_library() + +zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/inc) +zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/src) + +# This is for caliptra_top_reg.h which has all of the register definitions for Caliptra. +zephyr_library_include_directories(${ZEPHYR_CURRENT_MODULE_DIR}/../hw/latest/rtl/src/soc_ifc/rtl) + +zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/src/caliptra_api.c) + +endif() # CONFIG_LIBCALIPTRA diff --git a/libcaliptra/zephyr/Kconfig b/libcaliptra/zephyr/Kconfig new file mode 100644 index 0000000000..1f1bf097f5 --- /dev/null +++ b/libcaliptra/zephyr/Kconfig @@ -0,0 +1,14 @@ +# Licensed under the Apache-2.0 license + +menuconfig LIBCALIPTRA + bool "Enable Libcaliptra" + help + This is a library to help interface with Caliptra. + +if LIBCALIPTRA + +module = LIBCALIPTRA +module-str = libcaliptra +source "subsys/logging/Kconfig.template.log_config" + +endif # LIBCALIPTRA diff --git a/libcaliptra/zephyr/README.md b/libcaliptra/zephyr/README.md new file mode 100644 index 0000000000..a6128339b5 --- /dev/null +++ b/libcaliptra/zephyr/README.md @@ -0,0 +1,11 @@ +# Zephyr Project Configuration + +This directory contains everything needed to include Libcaliptra as a library +within a Zephyr project. + +It leaves the implementation for the functions in `caliptra_if.h` undefined. They +will need to be defined external to this directory. + +The module is labeled `LIBCALIPTRA`. It can be added to your Zephyr project with +`CONFIG_LIBCALIPTRA=y`. Be sure to add this directory to the list of +`ZEPHYR_MODULES` in the build rules. diff --git a/libcaliptra/zephyr/module.yml b/libcaliptra/zephyr/module.yml new file mode 100644 index 0000000000..190190e4bf --- /dev/null +++ b/libcaliptra/zephyr/module.yml @@ -0,0 +1,5 @@ +# Licensed under the Apache-2.0 license + +build: + cmake: zephyr + kconfig: zephyr/Kconfig