tpm: disociate TPMv1.x specific and generic code
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 15 May 2018 09:57:06 +0000 (11:57 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 26 May 2018 00:12:55 +0000 (20:12 -0400)
commitd677bfe2f7914367d1caa6146b34e86d0df1c75d
treea9fd34e6cceac25b6d232ab2d07460648cb53022
parent9f9ce3c369b7fbcc47496331ff28fad80302a42c
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>
26 files changed:
board/gdsys/a38x/controlcenterdc.c
board/gdsys/a38x/hre.c
board/gdsys/a38x/keyprogram.c
board/gdsys/p1022/controlcenterd-id.c
cmd/Makefile
cmd/tpm-common.c [new file with mode: 0644]
cmd/tpm-user-utils.h [new file with mode: 0644]
cmd/tpm-v1.c [new file with mode: 0644]
cmd/tpm.c [deleted file]
cmd/tpm_test.c
drivers/tpm/Kconfig
drivers/tpm/tpm-uclass.c
drivers/tpm/tpm_atmel_twi.c
drivers/tpm/tpm_tis_infineon.c
drivers/tpm/tpm_tis_lpc.c
drivers/tpm/tpm_tis_sandbox.c
drivers/tpm/tpm_tis_st33zp24_i2c.c
drivers/tpm/tpm_tis_st33zp24_spi.c
include/tpm-common.h [new file with mode: 0644]
include/tpm-v1.h [new file with mode: 0644]
include/tpm.h [deleted file]
lib/Makefile
lib/tpm-common.c [new file with mode: 0644]
lib/tpm-utils.h [new file with mode: 0644]
lib/tpm-v1.c [new file with mode: 0644]
lib/tpm.c [deleted file]