Implement support for wolfHAL I2C/SPI backends - #562
Open
AlexLanzano wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new wolfHAL-based IO backend so wolfTPM can communicate with a TPM over SPI or I2C on targets that use wolfHAL for peripheral access. This fits into the existing hal/ example callback framework and extends the build system and docs to expose the new backend as a selectable option.
Changes:
- Add
hal/tpm_io_wolfhal.cimplementing SPI and I2C IO callbacks using wolfHAL and application-providedboard.hdefinitions. - Wire wolfHAL into the HAL selection chain and public HAL prototypes (
hal/tpm_io.c,hal/tpm_io.h). - Expose
--enable-wolfhalinconfigure.acand document usage/requirements in the root README andhal/README.md.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents wolfHAL as a supported platform and adds --enable-wolfhal configuration flag details. |
| hal/tpm_io.h | Adds wolfHAL callback prototypes for SPI and I2C builds. |
| hal/tpm_io.c | Adds wolfHAL to the platform selection chain and dispatches to wolfHAL callbacks. |
| hal/tpm_io_wolfhal.c | New wolfHAL SPI/I2C backend implementation relying on application board.h macros. |
| hal/README.md | Adds wolfHAL section explaining enablement and required BOARD_* definitions with examples. |
| hal/include.am | Adds the new source file to the HAL build sources. |
| configure.ac | Adds --enable-wolfhal option and includes it in the configure summary output. |
AlexLanzano
force-pushed
the
wolfHAL-integration
branch
from
August 2, 2026 19:08
94bbc8b to
632031d
Compare
AlexLanzano
marked this pull request as ready for review
August 2, 2026 19:11
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #562
Scan targets checked: wolftpm-bugs, wolftpm-src
No new issues found in the changed files. ✅
AlexLanzano
force-pushed
the
wolfHAL-integration
branch
from
August 2, 2026 19:19
632031d to
92e3e7d
Compare
AlexLanzano
force-pushed
the
wolfHAL-integration
branch
from
August 2, 2026 19:26
92e3e7d to
0e7f312
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add wolfHAL support
Adds a wolfHAL IO backend so wolfTPM can talk to a TPM over SPI or I2C on
targets using wolfHAL for peripheral access.
Usage
Board definitions
wolfTPM does not ship board definitions.
tpm_io_wolfhal.cincludes"board.h", which the application provides. A wolfHAL project already hasone, so usually only the TPM entries need adding:
BOARD_SPI_DEVwhal_Spi*BOARD_SPI_COM_CFGwhal_Spi_ComCfg*BOARD_GPIO_DEVwhal_Gpio*(chip select)BOARD_CS_PINBOARD_I2C_DEVwhal_I2c*BOARD_I2C_COM_CFGwhal_I2c_ComCfg*(carries the TPM address)A missing entry is reported at compile time, naming the macro required.
See
hal/README.mdfor details and examples.