[SLOF] [PATCH v2 02/20] Add TPM initialization support

Thomas Huth thuth at redhat.com
Thu Nov 19 20:45:44 AEDT 2015


On 17/11/15 18:02, Stefan Berger wrote:
> From: Stefan Berger <stefanb at linux.vnet.ibm.com>
> 
> This patch implements the main part of the fimrmware extensions. It provides
> the following functionality:
> 
> - initialization of the TPM by sending a sequence of commands to it
> - proper setup of the TPM before the firmware hands over control to the bootloader
> 
> Structures that are needed in subsequent patches are also included in the
> private header file tcgbios_int.h at this point.
> 
> Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
...
> diff --git a/lib/libtpm/tpm.code b/lib/libtpm/tpm.code
> new file mode 100644
> index 0000000..e42fd0b
> --- /dev/null
> +++ b/lib/libtpm/tpm.code
> @@ -0,0 +1,37 @@
> +/******************************************************************************
> + * Copyright (c) 2015 IBM Corporation
> + * All rights reserved.
> + * This program and the accompanying materials
> + * are made available under the terms of the BSD License
> + * which accompanies this distribution, and is available at
> + * http://www.opensource.org/licenses/bsd-license.php
> + *
> + * Contributors:
> + *     IBM Corporation - initial implementation
> + *****************************************************************************/
> +/*
> + * libtpm bindings for SLOF - implementation
> + */
> +
> +#include <tcgbios.h>
> +
> +
> +/************************************************/
> +/* Startup TPM code                             */
> +/* SLOF:   tpm-start  ( -- errcode )            */
> +/* LIBNEWUSB: tpm_start(void)                   */

By the way, "LIBNEWUSB" seems inappropriate here...

> +/************************************************/
> +PRIM(tpm_X2d_start)
> +	PUSH;
> +	TOS.n = tpm_start();
> +MIRP
> +
> +/***************************************************************/
> +/* Prepare TPM state for bootloader                            */
> +/* SLOF:   tpm-unassert-physical-presence ( -- errcode )       */
> +/* LIBNEWUSB: tpm_unassert_physical-presence(void)             */

... and here.

> +/***************************************************************/
> +PRIM(tpm_X2d_unassert_X2d_physical_X2d_presence)
> +	PUSH;
> +	TOS.n = tpm_unassert_physical_presence();
> +MIRP

 Thomas



More information about the SLOF mailing list