Corrected defaults and autodetect.

pull/268/head
Bill Phipps 2023-04-18 15:05:44 -07:00
parent e95f2647d5
commit 36bbb57f67
2 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,9 @@ int TPM2_IoCb(TPM2_CTX* ctx, const byte* txBuf, byte* rxBuf,
## Additional Compiler macros ## Additional Compiler macros
* `TPM2_SPI_DEV_PATH`: Set to the device string to be opened by the Linux IOCb. Default: "/dev/spidev0." * `TPM2_SPI_DEV_PATH`: Set to the device string to be opened by the Linux IOCb. Default: "/dev/spidev0."
* `TPM2_SPI_DEV_CS`: Set to the number string of the CS to use or the lowest CS to try during autodetect. Default: "0" * `TPM2_SPI_DEV_CS`: Set to the number string of the CS to use. Default: "0"
These can be set during configure as: These can be set during configure as:
./configure CPPFLAGS="-DTPM2_SPI_DEV_PATH=\"/dev/spidev0.\" -DTPM2_SPI_DEV_CS=\"0\" " ./configure CPPFLAGS="-DTPM2_SPI_DEV_PATH=\"/dev/spidev0.\" -DTPM2_SPI_DEV_CS=\"0\" "
Note that autodetect will use TPM2_SPI_DEV_PATH[0..4] for the searched device paths.

View File

@ -80,7 +80,7 @@
#define TPM2_SPI_DEV_CS "0" #define TPM2_SPI_DEV_CS "0"
#else #else
/* OPTIGA SLB9670/SLB9762 and LetsTrust TPM use CE1 */ /* OPTIGA SLB9670/SLB9762 and LetsTrust TPM use CE1 */
#define TPM2_SPI_DEV_CS "0" #define TPM2_SPI_DEV_CS "1"
#endif #endif
#endif #endif
@ -91,7 +91,7 @@
#ifdef WOLFTPM_AUTODETECT #ifdef WOLFTPM_AUTODETECT
#undef TPM2_SPI_DEV #undef TPM2_SPI_DEV
/* this will try incrementing spidev chip selects */ /* this will try incrementing spidev chip selects */
static char TPM2_SPI_DEV[] = TPM2_SPI_DEV_PATH TPM2_SPI_DEV_CS; static char TPM2_SPI_DEV[] = TPM2_SPI_DEV_PATH "0";
#define MAX_SPI_DEV_CS '4' #define MAX_SPI_DEV_CS '4'
static int foundSpiDev = 0; static int foundSpiDev = 0;
#else #else