1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

tpm: disociate TPMv1.x specific and generic code

There are no changes in this commit but a new organization of the code
as follow.

* cmd/ directory:
        > move existing code from cmd/tpm.c in cmd/tpm-common.c
	> move specific code in cmd/tpm-v1.c
	> create a specific header file with generic definitions for
	  commands only called cmd/tpm-user-utils.h

* lib/ directory:
        > move existing code from lib/tpm.c in lib/tpm-common.c
	> move specific code in lib/tpm-v1.c
	> create a specific header file with generic definitions for
	  the library itself called lib/tpm-utils.h

* include/ directory:
        > move existing code from include/tpm.h in include/tpm-common.h
	> move specific code in include/tpm-v1.h

Code designated as 'common' is compiled if TPM are used. Code designated
as 'specific' is compiled only if the right specification has been
selected.

All files include tpm-common.h.
Files in cmd/ include tpm-user-utils.h.
Files in lib/ include tpm-utils.h.
Depending on the specification, files may include either (not both)
tpm-v1.h or tpm-v2.h.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Fix a few more cases of tpm.h -> tpm-v1.h, some Kconfig logic]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Miquel Raynal
2018-05-15 11:57:06 +02:00
committed by Tom Rini
parent 9f9ce3c369
commit d677bfe2f7
23 changed files with 856 additions and 752 deletions

View File

@@ -46,7 +46,7 @@ config TPM_TIS_INFINEON
config TPM_TIS_I2C_BURST_LIMITATION
bool "Enable I2C burst length limitation"
depends on TPM_V1 && TPM_TIS_INFINEON
depends on TPM_TIS_INFINEON
help
Some broken TPMs have a limitation on the number of bytes they can
receive in one message. Enable this option to allow you to set this
@@ -62,6 +62,7 @@ config TPM_TIS_I2C_BURST_LIMITATION_LEN
config TPM_TIS_LPC
bool "Enable support for Infineon SLB9635/45 TPMs on LPC"
depends on TPM_V1 && X86
select TPM_DRIVER_SELECTED
help
This driver supports Infineon TPM devices connected on the LPC bus.
The usual tpm operations and the 'tpm' command can be used to talk

View File

@@ -6,8 +6,10 @@
#include <common.h>
#include <dm.h>
#include <tpm.h>
#include <linux/unaligned/be_byteshift.h>
#if defined(CONFIG_TPM_V1)
#include <tpm-v1.h>
#endif
#include "tpm_internal.h"
int tpm_open(struct udevice *dev)

View File

@@ -7,7 +7,7 @@
#include <common.h>
#include <dm.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <i2c.h>
#include <asm/unaligned.h>

View File

@@ -23,7 +23,7 @@
#include <dm.h>
#include <fdtdec.h>
#include <i2c.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <linux/errno.h>
#include <linux/compiler.h>
#include <linux/types.h>

View File

@@ -15,7 +15,7 @@
#include <common.h>
#include <dm.h>
#include <mapmem.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <asm/io.h>
#define PREFIX "lpc_tpm: "

View File

@@ -5,7 +5,7 @@
#include <common.h>
#include <dm.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <asm/state.h>
#include <asm/unaligned.h>
#include <linux/crc8.h>

View File

@@ -16,7 +16,7 @@
#include <dm.h>
#include <fdtdec.h>
#include <i2c.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <errno.h>
#include <linux/types.h>
#include <asm/unaligned.h>

View File

@@ -16,7 +16,7 @@
#include <dm.h>
#include <fdtdec.h>
#include <spi.h>
#include <tpm.h>
#include <tpm-v1.h>
#include <errno.h>
#include <linux/types.h>
#include <asm/unaligned.h>