Skip to content

Commit

Permalink
Add Zephyr project definitions for Libcaliptra.
Browse files Browse the repository at this point in the history
This allows including Libcaliptra in a Zephyr project.
  • Loading branch information
zhalvorsen authored and jhand2 committed Oct 10, 2024
1 parent c26d480 commit d06dd68
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libcaliptra/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions libcaliptra/zephyr/Kconfig
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions libcaliptra/zephyr/README.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions libcaliptra/zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Licensed under the Apache-2.0 license

build:
cmake: zephyr
kconfig: zephyr/Kconfig

0 comments on commit d06dd68

Please sign in to comment.