From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 19 Jul 2018 20:17:11 -0600 Subject: [U-Boot] [PATCH v2 4/7] tpm: allow TPM v1 and v2 to be compiled at the same time In-Reply-To: <20180719203512.346-5-miquel.raynal@bootlin.com> References: <20180719203512.346-1-miquel.raynal@bootlin.com> <20180719203512.346-5-miquel.raynal@bootlin.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 19 July 2018 at 14:35, Miquel Raynal wrote: > While there is probably no reason to do so in a real life situation, it > will allow to compile test both stacks with the same sandbox defconfig. > > As we cannot define two 'tpm' commands at the same time, the command for > TPM v1 is still called 'tpm' and the one for TPM v2 'tpm2'. While this > is the exact command name that must be written into eg. test files, any > user already using the TPM v2 stack can continue to do so by just writing > 'tpm' because as long as TPM v1 support is not compiled, U-Boot prompt > will search for the closest command named after 'tpm'. > > The command set can also be changed at runtime (not supported yet, but > ready to be), but as one can compile only either one stack or the other, > there is still one spot in the code where conditionals are used: to > retrieve the v1 or v2 command set. > > Signed-off-by: Miquel Raynal > --- > cmd/tpm-common.c | 24 +++++++++++++++++++++++- > cmd/tpm-v1.c | 2 +- > cmd/tpm-v2.c | 4 ++-- > drivers/tpm/Kconfig | 7 ++----- > drivers/tpm/tpm-uclass.c | 3 --- > drivers/tpm/tpm2_tis_sandbox.c | 3 +++ > drivers/tpm/tpm2_tis_spi.c | 4 ++++ > include/tpm-common.h | 40 ++++++++++++++++++++++++++++++++++------ > 8 files changed, 69 insertions(+), 18 deletions(-) Reviewed-by: Simon Glass